feat(v1.7b): static pages + navigation manager + legal seeder (closes #32)#39
Merged
Conversation
…32) Second half of v1.7. With v1.7a (media folders + reusable blocks + cookie consent + legal templates) merged earlier, this completes the v1.7 milestone. Pages ----- - ContentProvider: getPage / getPageBySlug / listPages / createPage / updatePage / deletePage. Soft scheduled-publishing semantics identical to articles (status='published' AND publishedAt <= now). - Public: (www)/[locale]/[...slug] catch-all. SvelteKit prefers the more-specific /[locale]/blog and /[locale]/blog/[slug] routes so the catch-all only triggers for static pages. Three soft templates (default, landing, legal) swap the public wrapper. - Reuses v1.6 <Seo> + v1.7a expandBlocks, so canonical + hreflang + Open Graph + Article-style JSON-LD all just work, and {{block:key}} shortcodes expand inside pages too. - CMS: /cms/pages (list), /cms/pages/new, /cms/pages/[id] (edit). Shared PageForm.svelte modeled on ArticleForm. - Sitemap: per-locale sitemap now lists pages in addition to articles, with hreflang siblings only for locales with real content. Navigation manager ------------------ - ContentProvider: listMenus / getMenuByKey / createMenu / deleteMenu / createNavigationItem / updateNavigationItem / deleteNavigationItem / reorderNavigationItems. - /cms/navigation auto-bootstraps two stock menus (primary, footer) on first load. Per-locale labels stored as JSON. Items target one of article / category / tag / page / custom URL. Position-based ordering with up/down buttons (true drag-drop trees deferred). - $lib/server/content/navigation.ts: loadNavigation() pre-fetches the menus + the slug lookup tables in one pass; navItemHref() resolves each item to a final URL with O(1) lookups. - (www) layout server load consumes loadNavigation() and surfaces data.nav.{primary,footer} as render-ready arrays. Header iterates primary; footer iterates footer. Legal seeder ------------ - $lib/server/content/legal-seed.ts: seedLegalPages(content, authorId) embeds the privacy + cookie policy templates, prefills [Site Name] from site_settings, and creates draft Pages with the 'legal' template. Idempotent: skips slugs that already exist. - /cms/pages empty state shows a "Seed legal templates" button that invokes the seeder. New pages start as drafts (never auto-publish) with explicit "review before publishing" copy on the success banner. Sidebar ------- - Two new entries: Pages and Navigation, both gated to editor+. i18n: 23 new keys (EN + TH). cms_pages_*, cms_navigation_*, cms_pages_seed_legal, cms_pages_seeded. Closes #32 (full v1.7 — both halves merged). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
thunpisit
added a commit
to codustry/khaopad-example
that referenced
this pull request
Apr 30, 2026
…am PR codustry#39) (#6) Cherry-picks upstream PR codustry#39 (closes codustry#32). v1.7 schema (migration 0005) was already applied to live D1 in v1.7a. i18n: 23 new keys field-merged into messages/en.json + th.json (example-specific copy preserved). Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #32. v1.7b — second half of the IA milestone. With v1.7a (media folders + reusable blocks + cookie consent + legal templates) merged earlier, this completes v1.7.
Pages
Navigation manager
Legal seeder
Sidebar
Two new entries (editor+ gated): Pages, Navigation.
i18n
23 new keys (EN + TH).
Test plan
🤖 Generated with Claude Code