From 212a98e7f2b1b9a43def875318a38c170332369f Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Thu, 10 Sep 2026 08:51:59 +0200 Subject: [PATCH] Theme refactor: shared base.css + palette-only themes (minified); template P4/P5/P7/P11 skip-link; per-image alt; system theme default --- .gitignore | 1 + templates/share/page.ejs | 32 +- theme/blog_share_base.css | 507 +++++++++++++++++++ theme/blog_share_theme_coffee.css | 482 +----------------- theme/blog_share_theme_gruvbox.css | 482 +----------------- theme/blog_share_theme_harbor.css | 482 +----------------- theme/blog_share_theme_solarized.css | 482 +----------------- theme/blog_share_theme_tokyonight.css | 482 +----------------- tools/__pycache__/minify_css.cpython-311.pyc | Bin 0 -> 2474 bytes tools/minify_css.py | 33 ++ 10 files changed, 619 insertions(+), 2364 deletions(-) create mode 100644 .gitignore create mode 100644 theme/blog_share_base.css create mode 100644 tools/__pycache__/minify_css.cpython-311.pyc create mode 100644 tools/minify_css.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..433b482 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.min.css diff --git a/templates/share/page.ejs b/templates/share/page.ejs index 2818912..594184b 100644 --- a/templates/share/page.ejs +++ b/templates/share/page.ejs @@ -34,7 +34,15 @@ if (subRoot.note.hasRelation("shareOpenGraphImage")) { ogImageRel = `api/images/${subRoot.note.getRelation("shareOpenGraphImage").value}/image.png`; } - const ogImage = ogImageRel ? rootUrl + ogImageRel : ""; + // Per-article OG image: a thumbnail child note beats the site-wide fallback. + if (note.getLabelValue("publish") === "true") { + try { + const thumbs = (note.getChildNotes() || []) + .filter(n => /^(?:thumb|.+_thumb)\.[A-Za-z0-9]+$/i.test(n.title)); + if (thumbs.length) ogImageRel = `api/notes/${thumbs[0].noteId}/download`; + } catch (e) {} + } + const ogImage = ogImageRel ? (ogImageRel.startsWith("http") ? ogImageRel : rootUrl + ogImageRel) : ""; const jsonLd = []; if (note.noteId === subRoot.note.noteId) { @@ -71,8 +79,9 @@ <%= pageTitle %> <% if (pageUrl) { %><% } %>