From de9a1799d1d865da0ee4e78e0d91d83fa6a2bd44 Mon Sep 17 00:00:00 2001 From: prescientmoon <git@moonythm.dev> Date: Thu, 28 Nov 2024 15:31:05 +0100 Subject: [PATCH] Experiment with neuromorphism --- justfile | 3 +++ public/styles.css | 14 ++++++++++++++ src/html.rs | 11 +++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index a2b5abb..1ec0051 100644 --- a/justfile +++ b/justfile @@ -1,6 +1,9 @@ minify-sitemap: xmllint --noblanks dist/sitemap.xml --output dist/sitemap.xml +serve-dev: + http-server dist + # {{{ Linting lint: lint-vnu lint-css lint-htmltest lint-htmlvalidate diff --git a/public/styles.css b/public/styles.css index 661ea99..8a343f4 100644 --- a/public/styles.css +++ b/public/styles.css @@ -29,6 +29,15 @@ h6 { /* Note: I need to check whether this only aligns things better with the font I use */ transform: translateY(-2px); } + + /* Neuromoprhism */ + /* &:has(.heading-anchor) { */ + /* padding: 0.5rem 1rem; */ + /* border-radius: 6px; */ + /* box-shadow: */ + /* 3px 3px 6px #cccbc9, */ + /* -3px -3px 10px white; */ + /* } */ } math[display="block"] { @@ -211,6 +220,11 @@ math[display="block"] { border-radius: 3px; border: 1px solid black; + /* Neuromoprhism */ + /* box-shadow: */ + /* inset 3px 3px 6px #cccbc9, */ + /* inset -3px -3px 6px white; */ + box-sizing: border-box; padding: 1rem; margin: 1.5rem 0; diff --git a/src/html.rs b/src/html.rs index a110070..f036a2f 100644 --- a/src/html.rs +++ b/src/html.rs @@ -272,11 +272,16 @@ impl<'s> Writer<'s> { Container::Div { class: "posts" } => { write!(out, r#"<ol class="article-list">"#)?; for post in self.pages { - // Skip drafts - if post.config.created_at.is_none() { + // Skip non-posts + if !matches!(post.route, PageRoute::Post(_)) { continue; } + // Skip drafts + // if post.config.created_at.is_none() { + // continue; + // } + template!("templates/post-summary.html", out)?.feed( out, |label, out| { @@ -284,6 +289,8 @@ impl<'s> Writer<'s> { "id" => { if let PageRoute::Post(id) = &post.route { write!(out, "{id}")?; + } else { + unreachable!() } } "title" => {