From 4d6735f6095df09903dff3209bfccda4f6ac47d9 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Wed, 23 Sep 2026 06:10:01 +0000 Subject: [PATCH] Fix card image priority: own > mined from article > inherited The resolved (inheriting) Node.image was checked before mining the article, so a front-page banner image shadowed the articles' own extracted figures everywhere: card covers, og:image and the editor's card previews. --- docs/backend.md | 4 +-- docs/content-model.md | 2 +- docs/design-principles.md | 2 +- docs/editing.md | 2 +- frontend/src/BannerEditor.vue | 16 +++++++----- pagerite/api.py | 3 ++- pagerite/views.py | 48 +++++++++++++++++++++++++---------- 7 files changed, 52 insertions(+), 25 deletions(-) diff --git a/docs/backend.md b/docs/backend.md index 6adf675..ab769ba 100644 --- a/docs/backend.md +++ b/docs/backend.md @@ -34,11 +34,11 @@ markdown-it-py renderer (html passthrough + attrs, footnote, deflist, tasklists, The shared page layout as an html5tagger `Template` with placeholders (`Title`, `Brand`, `Banner`, `Nav`, `Sidebar`, `Main`), nav rendering straight from the `Data.menu` tree (siblings sorted by `Node.order`; nav links to content-less labels point at their first child via `first_leaf`, the first published descendant with content), and page/404 rendering. -Content pages get SEO/social meta (description, canonical link, Open Graph + twitter card) from heuristics over the rendered article: the description is the first paragraph's text; the card image is the node's own `Node.image` when one resolves (nearest ancestor, front page last — see docs/content-model.md), otherwise mined from the article, preferring a `{.hero}`-classed image, then the first raster ``, then the first SVG; the first `