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

This commit is contained in:
2025-11-04 20:06:19 -08:00
parent 7afc0b2a29
commit e9863707d8
3 changed files with 33 additions and 26 deletions

View File

@@ -10,6 +10,8 @@
padding-right: 1ex; padding-right: 1ex;
} }
// Only do hover magic on mouse devices
@media(hover: hover) and (pointer: fine) {
.handout-ul li:hover { .handout-ul li:hover {
margin-left: 1ex; margin-left: 1ex;
transition: 50ms; transition: 50ms;
@@ -20,21 +22,21 @@
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.

View File

@@ -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)

View File

@@ -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" {
"[ " "[ "