From 512ed91b319e4ea5c0fb3e063923a7df32458f0c Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Wed, 19 Aug 2026 01:40:26 +0000 Subject: [PATCH] Bottom-anchor banner artwork, instant navigation via in-memory page cache, seed/stars/structure tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix banner artwork sizing: explicit 100% grid track so children stretch instead of resolving height:100% against a content-sized row (SVG intrinsic ratio bloated the row, cropping the artwork's bottom). Bottom-anchor via object-position, transform-origin and YMax slice. - pagerite.js: in-memory page cache — preload every visible internal link once, serve navigation from memory without fetching; editors' loadPlain keeps the cache in sync (pagerite:page-fetched). - Structure editor: delete pages directly, no two-step confirmation. - New 'stars' banner design (drifting starfield) alongside 'eyes'. - Rewrite seed content: welcome page, three-level docs section covering all Markdown features (source + rendered), showcase hierarchy with image positioning and a simple leaf-page banner example. --- AGENTS.md | 11 +- frontend/src/StructureEditor.vue | 22 +- frontend/src/StructureTree.vue | 11 +- frontend/src/assets/pagerite.css | 23 +- frontend/src/pagerite.js | 63 ++-- frontend/src/swapdoc.js | 6 +- pagerite/app.py | 11 +- pagerite/seed.py | 417 +++++++++++++++++---------- pagerite/themes/corporate/banner.svg | 2 +- pagerite/themes/nitro/banner.svg | 2 +- pagerite/themes/purple/banner.svg | 2 +- pagerite/themes/stars/banner.css | 7 + pagerite/themes/stars/banner.html | 52 ++++ pagerite/themes/summer/banner.svg | 2 +- 14 files changed, 409 insertions(+), 222 deletions(-) create mode 100644 pagerite/themes/stars/banner.css create mode 100644 pagerite/themes/stars/banner.html diff --git a/AGENTS.md b/AGENTS.md index 99ca732..5535aed 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -129,7 +129,12 @@ not for the public pages. See `docs/design-principles.md` for the design. created, via a `@kanta.bootstrap` handler in `app.py`. - `frontend/src/` — the Vue editor and public-page entries. - `main.js` — Vue editor app entry, mounts the tabbed EditorShell. - - `pagerite.js` — public page entry; runs fetch-navigation, scroll-reveal, + - `pagerite.js` — public page entry; runs fetch-navigation (backed by an + in-memory page cache: every visible internal link — and the current + page — is fetched once at load, clicks are then served from JS with no + fetch, and the editors' `loadPlain` keeps the cache current via a + `pagerite:page-fetched` event; articles are `cache-control: no-cache` + on the wire), scroll-reveal, OverlayScrollbars on `document.body` (floating, auto-hiding scrollbars that never reserve layout space or shift the page when appearing; native scroll APIs like `window.scrollTo` keep working; themed via the @@ -174,7 +179,9 @@ not for the public pages. See `docs/design-principles.md` for the design. gradient brand, flower bullets, and a layered-parallax banner (sun rises, clouds drift, nearer hills move less) with idle animations (swaying flowers, floating clouds, breathing sun glow) wrapped in - `prefers-reduced-motion: no-preference`) and the + `prefers-reduced-motion: no-preference`); standalone banner designs + (no theme.css) ship as `eyes` (a canvas critter in the grass) and + `stars` (a drifting starfield)) and the companion `banner.css` banner designs are served by the backend. - Vite builds ES-module `.js` outputs; the backend renders ` +ABOUT = """\ +This site runs on **Pagerite**: FastAPI + html5tagger + kanta, with content written in Markdown and rendered on the fly. + +- [How to edit this site](/docs/editing) +- [Markdown features](/docs/markdown/basics) +- [The showcase](/showcase/gallery) + +*Replace this page with whatever your site is about.* """ -BLOG_BANNER = '
' +BANNER_DIV = ( + '
' +) WAVES_SVG = """\ @@ -231,33 +340,45 @@ DUNES_SVG = """\ """ #: path -> (title, markdown, {filename: bytes}, banner HTML, menu order, -#: banner design). Banners are deliberately set only on select sub pages -#: (not the front page), so the theme's default design shows elsewhere. -#: Note there are deliberately no "docs" or "blog" landing pages: those -#: labels are created without content, so they render a placeholder page -#: and their nav links point at the first child (see views.first_leaf). +#: banner design). Banners are deliberately set only on one leaf page +#: (showcase/night-sky), so nothing else inherits a custom banner. +#: Note there are deliberately no "docs" or "showcase" landing pages: +#: those labels are created without content, so they render a placeholder +#: page and their nav links point at the first child (see +#: views.first_leaf). PAGES: dict[str, tuple[str, str, dict[str, bytes], str, float, str | None]] = { "": ("Welcome", WELCOME, {"waves.svg": WAVES_SVG.encode()}, "", 1, None), - "about": ("About", ABOUT, {}, "", 2, None), - "docs/editing": ( - "Writing Content", - EDITING, - {"shapes.svg": SHAPES_SVG.encode()}, + "about": ("About", ABOUT, {}, "", 3, None), + "docs/editing": ("Editing This Site", EDITING, {}, "", 1, None), + "docs/markdown/basics": ( + "Markdown Basics", + MD_BASICS, + {}, "", 1, None, ), - "blog/the-long-read": ( - "The Long Read", - LONG_READ, - {"dunes.svg": DUNES_SVG.encode()}, - BLOG_BANNER, + "docs/markdown/extensions": ("Markdown Extensions", MD_EXTENSIONS, {}, "", 2, None), + "docs/markdown/images-and-layout": ( + "Images and Layout", + MD_LAYOUT, + {"shapes.svg": SHAPES_SVG.encode(), "dunes.svg": DUNES_SVG.encode()}, + "", + 3, + None, + ), + "showcase/gallery": ( + "Gallery", + GALLERY, + { + "shapes.svg": SHAPES_SVG.encode(), + "waves.svg": WAVES_SVG.encode(), + "dunes.svg": DUNES_SVG.encode(), + }, + "", 1, None, ), - # The eyes critter is a named banner design (pagerite/themes/eyes/), - # not code embedded in the page. - "blog/notes-on-urls": ("Notes on URLs", NOTES_ON_URLS, {}, "", 2, "eyes"), - "blog/canvas-nights": ("Canvas Nights", CANVAS_NIGHTS, {}, CANVAS_BANNER, 3, None), - "blog/small-releases": ("Small Releases", SMALL_RELEASES, {}, "", 4, None), + "showcase/night-sky": ("Night Sky", NIGHT_SKY, {}, BANNER_DIV, 2, None), + "showcase/small-releases": ("Small Releases", SMALL_RELEASES, {}, "", 3, None), } diff --git a/pagerite/themes/corporate/banner.svg b/pagerite/themes/corporate/banner.svg index 8cb3d41..7619ea4 100644 --- a/pagerite/themes/corporate/banner.svg +++ b/pagerite/themes/corporate/banner.svg @@ -1,4 +1,4 @@ - + diff --git a/pagerite/themes/nitro/banner.svg b/pagerite/themes/nitro/banner.svg index c7052b5..7d485b5 100644 --- a/pagerite/themes/nitro/banner.svg +++ b/pagerite/themes/nitro/banner.svg @@ -1,4 +1,4 @@ - + diff --git a/pagerite/themes/purple/banner.svg b/pagerite/themes/purple/banner.svg index 45814a3..cbb05ae 100644 --- a/pagerite/themes/purple/banner.svg +++ b/pagerite/themes/purple/banner.svg @@ -1,4 +1,4 @@ - + diff --git a/pagerite/themes/stars/banner.css b/pagerite/themes/stars/banner.css new file mode 100644 index 0000000..015a1ac --- /dev/null +++ b/pagerite/themes/stars/banner.css @@ -0,0 +1,7 @@ +/* Stars banner design: a drifting starfield (banner.html — canvas + script + inlined by the backend into #page-banner). Fixed-height stage matching + the canvas. */ + +#banner { + height: 240px; +} diff --git a/pagerite/themes/stars/banner.html b/pagerite/themes/stars/banner.html new file mode 100644 index 0000000..8812a9c --- /dev/null +++ b/pagerite/themes/stars/banner.html @@ -0,0 +1,52 @@ + + +