Minor tweaks
All checks were successful
CI / Check typos (push) Successful in 8s
CI / Check links (push) Successful in 9s
CI / Clippy (push) Successful in 50s
CI / Build and test (push) Successful in 2m15s
CI / Build container (push) Successful in 1m43s
CI / Deploy on waypoint (push) Successful in 54s
All checks were successful
CI / Check typos (push) Successful in 8s
CI / Check links (push) Successful in 9s
CI / Clippy (push) Successful in 50s
CI / Build and test (push) Successful in 2m15s
CI / Build container (push) Successful in 1m43s
CI / Deploy on waypoint (push) Successful in 54s
This commit is contained in:
@@ -10,32 +10,34 @@
|
|||||||
padding-right: 1ex;
|
padding-right: 1ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.handout-ul li:hover {
|
// Only do hover magic on mouse devices
|
||||||
|
@media(hover: hover) and (pointer: fine) {
|
||||||
|
.handout-ul li:hover {
|
||||||
margin-left: 1ex;
|
margin-left: 1ex;
|
||||||
transition: 50ms;
|
transition: 50ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
.handout-ul li {
|
.handout-ul li {
|
||||||
transition: 50ms;
|
transition: 50ms;
|
||||||
transition-delay: 50ms;
|
transition-delay: 50ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.handout-ul li:hover .handout-li-links {
|
||||||
.handout-ul li:hover .handout-li-links,
|
|
||||||
.handout-ul .handout-li-desc {
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transition: 100ms;
|
transition: 100ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
.handout-ul li:hover .handout-li-desc,
|
.handout-ul li .handout-li-links {
|
||||||
.handout-ul li .handout-li-links {
|
|
||||||
transition-delay: 50ms;
|
transition-delay: 50ms;
|
||||||
transition: 100ms;
|
transition: 100ms;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
display: none;
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Email obfuscation
|
// Email obfuscation
|
||||||
// Works with "{{ email_*() }}" shortcodes.
|
// Works with "{{ email_*() }}" shortcodes.
|
||||||
.eobf {
|
.eobf {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
use axum::{
|
use axum::{
|
||||||
Router,
|
Router,
|
||||||
extract::{ConnectInfo, Path, State},
|
extract::{ConnectInfo, Path, State},
|
||||||
http::{HeaderValue, StatusCode, header},
|
http::{HeaderMap, HeaderValue, StatusCode, header},
|
||||||
response::{IntoResponse, Response},
|
response::{IntoResponse, Response},
|
||||||
routing::get,
|
routing::get,
|
||||||
};
|
};
|
||||||
@@ -83,7 +83,8 @@ impl PageMetadata {
|
|||||||
root_node: &Node,
|
root_node: &Node,
|
||||||
) -> Result<Option<PageMetadata>, serde_yaml::Error> {
|
) -> Result<Option<PageMetadata>, serde_yaml::Error> {
|
||||||
root_node
|
root_node
|
||||||
.children.first()
|
.children
|
||||||
|
.first()
|
||||||
.and_then(|x| x.cast::<FrontMatter>())
|
.and_then(|x| x.cast::<FrontMatter>())
|
||||||
.map(|x| serde_yaml::from_str::<PageMetadata>(&x.content))
|
.map(|x| serde_yaml::from_str::<PageMetadata>(&x.content))
|
||||||
.map_or(Ok(None), |v| v.map(Some))
|
.map_or(Ok(None), |v| v.map(Some))
|
||||||
@@ -298,8 +299,9 @@ impl PageServer {
|
|||||||
Path(route): Path<String>,
|
Path(route): Path<String>,
|
||||||
State(state): State<Arc<Self>>,
|
State(state): State<Arc<Self>>,
|
||||||
ConnectInfo(addr): ConnectInfo<ServiceConnectInfo>,
|
ConnectInfo(addr): ConnectInfo<ServiceConnectInfo>,
|
||||||
|
headers: HeaderMap,
|
||||||
) -> Response {
|
) -> Response {
|
||||||
trace!("Serving {route} to {}", addr.addr);
|
trace!(message = "Serving route", route, addr = ?addr.addr, user_agent = ?headers["user-agent"]);
|
||||||
|
|
||||||
let now = Utc::now();
|
let now = Utc::now();
|
||||||
let headers = [(
|
let headers = [(
|
||||||
@@ -326,7 +328,9 @@ impl PageServer {
|
|||||||
Router::new()
|
Router::new()
|
||||||
.route(
|
.route(
|
||||||
"/",
|
"/",
|
||||||
get(|state, conn| async { Self::handler(Path(String::new()), state, conn).await }),
|
get(|state, conn, headers| async {
|
||||||
|
Self::handler(Path(String::new()), state, conn, headers).await
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
.route("/{*path}", get(Self::handler))
|
.route("/{*path}", get(Self::handler))
|
||||||
.with_state(self)
|
.with_state(self)
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ fn build_list_for_group(handouts: &[HandoutEntry], group: &str) -> Markup {
|
|||||||
span class="handdout-li-title" {
|
span class="handdout-li-title" {
|
||||||
strong { (h.title) }
|
strong { (h.title) }
|
||||||
}
|
}
|
||||||
|
" "
|
||||||
span class="handout-li-links" {
|
span class="handout-li-links" {
|
||||||
"[ "
|
"[ "
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ fn build_list_for_group(handouts: &[HandoutEntry], group: &str) -> Markup {
|
|||||||
} @else {
|
} @else {
|
||||||
a href=(h.handout) {"handout"}
|
a href=(h.handout) {"handout"}
|
||||||
}
|
}
|
||||||
"] "
|
" ]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user