@kamod-ch/preactpress 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -49
- package/bin/preactpress.mjs +5 -5
- package/dist/client/app.d.ts +1 -1
- package/dist/client/app.d.ts.map +1 -1
- package/dist/client/app.js +55 -42
- package/dist/client/app.js.map +1 -1
- package/dist/client/entry-client.js +11 -12
- package/dist/client/entry-client.js.map +1 -1
- package/dist/client/entry-ssr.d.ts +2 -2
- package/dist/client/entry-ssr.d.ts.map +1 -1
- package/dist/client/entry-ssr.js +16 -16
- package/dist/client/entry-ssr.js.map +1 -1
- package/dist/client/index.d.ts +3 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/loadPage.d.ts +2 -1
- package/dist/client/loadPage.d.ts.map +1 -1
- package/dist/client/loadPage.js +15 -12
- package/dist/client/loadPage.js.map +1 -1
- package/dist/client/prefetchLinks.js +4 -4
- package/dist/client/prefetchLinks.js.map +1 -1
- package/dist/client/theme-default/AlgoliaSearch.d.ts +3 -3
- package/dist/client/theme-default/AlgoliaSearch.d.ts.map +1 -1
- package/dist/client/theme-default/AlgoliaSearch.js +15 -15
- package/dist/client/theme-default/AlgoliaSearch.js.map +1 -1
- package/dist/client/theme-default/Features.d.ts +2 -2
- package/dist/client/theme-default/Features.d.ts.map +1 -1
- package/dist/client/theme-default/Features.js +10 -8
- package/dist/client/theme-default/Features.js.map +1 -1
- package/dist/client/theme-default/Hero.d.ts +2 -2
- package/dist/client/theme-default/Hero.d.ts.map +1 -1
- package/dist/client/theme-default/Hero.js +9 -7
- package/dist/client/theme-default/Hero.js.map +1 -1
- package/dist/client/theme-default/Layout.d.ts +3 -3
- package/dist/client/theme-default/Layout.d.ts.map +1 -1
- package/dist/client/theme-default/Layout.js +56 -99
- package/dist/client/theme-default/Layout.js.map +1 -1
- package/dist/client/theme-default/Logo.d.ts +2 -2
- package/dist/client/theme-default/Logo.d.ts.map +1 -1
- package/dist/client/theme-default/Logo.js +8 -8
- package/dist/client/theme-default/Logo.js.map +1 -1
- package/dist/client/theme-default/NavLinks.d.ts +2 -2
- package/dist/client/theme-default/NavLinks.d.ts.map +1 -1
- package/dist/client/theme-default/NavLinks.js +3 -3
- package/dist/client/theme-default/NavLinks.js.map +1 -1
- package/dist/client/theme-default/SidebarNav.d.ts +2 -2
- package/dist/client/theme-default/SidebarNav.d.ts.map +1 -1
- package/dist/client/theme-default/SidebarNav.js +3 -3
- package/dist/client/theme-default/SidebarNav.js.map +1 -1
- package/dist/client/theme-default/SocialLinks.d.ts +2 -2
- package/dist/client/theme-default/SocialLinks.d.ts.map +1 -1
- package/dist/client/theme-default/SocialLinks.js +1 -1
- package/dist/client/theme-default/SocialLinks.js.map +1 -1
- package/dist/client/theme-default/ThemeToggle.d.ts +2 -3
- package/dist/client/theme-default/ThemeToggle.d.ts.map +1 -1
- package/dist/client/theme-default/ThemeToggle.js +2 -30
- package/dist/client/theme-default/ThemeToggle.js.map +1 -1
- package/dist/client/theme-default/index.d.ts +1 -1
- package/dist/client/theme-default/index.d.ts.map +1 -1
- package/dist/client/theme-default/index.js +1 -1
- package/dist/client/theme-default/index.js.map +1 -1
- package/dist/client/theme-utils.d.ts +24 -0
- package/dist/client/theme-utils.d.ts.map +1 -0
- package/dist/client/theme-utils.js +107 -0
- package/dist/client/theme-utils.js.map +1 -0
- package/dist/client/types.d.ts +5 -5
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/usePageHead.d.ts +2 -2
- package/dist/client/usePageHead.d.ts.map +1 -1
- package/dist/client/usePageHead.js +61 -56
- package/dist/client/usePageHead.js.map +1 -1
- package/dist/client/useSiteSearch.d.ts.map +1 -1
- package/dist/client/useSiteSearch.js +8 -8
- package/dist/client/useSiteSearch.js.map +1 -1
- package/dist/node/build.d.ts +1 -1
- package/dist/node/build.d.ts.map +1 -1
- package/dist/node/build.js +105 -96
- package/dist/node/build.js.map +1 -1
- package/dist/node/buildCache.d.ts.map +1 -1
- package/dist/node/buildCache.js +7 -7
- package/dist/node/buildCache.js.map +1 -1
- package/dist/node/check.d.ts +1 -1
- package/dist/node/check.d.ts.map +1 -1
- package/dist/node/check.js +52 -52
- package/dist/node/check.js.map +1 -1
- package/dist/node/cli.js +61 -64
- package/dist/node/cli.js.map +1 -1
- package/dist/node/config-helpers.d.ts +4 -4
- package/dist/node/config-helpers.d.ts.map +1 -1
- package/dist/node/config-helpers.js +1 -1
- package/dist/node/config-helpers.js.map +1 -1
- package/dist/node/config.d.ts +4 -4
- package/dist/node/config.d.ts.map +1 -1
- package/dist/node/config.js +37 -40
- package/dist/node/config.js.map +1 -1
- package/dist/node/content.d.ts +4 -4
- package/dist/node/content.d.ts.map +1 -1
- package/dist/node/content.js +28 -28
- package/dist/node/content.js.map +1 -1
- package/dist/node/createContentLoader.d.ts +1 -1
- package/dist/node/createContentLoader.d.ts.map +1 -1
- package/dist/node/createContentLoader.js +3 -3
- package/dist/node/createContentLoader.js.map +1 -1
- package/dist/node/devCss.d.ts +1 -1
- package/dist/node/devCss.d.ts.map +1 -1
- package/dist/node/devCss.js +5 -6
- package/dist/node/devCss.js.map +1 -1
- package/dist/node/devSsr.d.ts +3 -3
- package/dist/node/devSsr.d.ts.map +1 -1
- package/dist/node/devSsr.js +32 -32
- package/dist/node/devSsr.js.map +1 -1
- package/dist/node/dynamicRoutes.d.ts +2 -2
- package/dist/node/dynamicRoutes.d.ts.map +1 -1
- package/dist/node/dynamicRoutes.js +24 -24
- package/dist/node/dynamicRoutes.js.map +1 -1
- package/dist/node/favicon.d.ts +2 -2
- package/dist/node/favicon.d.ts.map +1 -1
- package/dist/node/favicon.js +26 -24
- package/dist/node/favicon.js.map +1 -1
- package/dist/node/feed.d.ts +2 -2
- package/dist/node/feed.d.ts.map +1 -1
- package/dist/node/feed.js +18 -16
- package/dist/node/feed.js.map +1 -1
- package/dist/node/hooks.d.ts +2 -2
- package/dist/node/hooks.d.ts.map +1 -1
- package/dist/node/hooks.js +1 -1
- package/dist/node/hooks.js.map +1 -1
- package/dist/node/html.d.ts +8 -8
- package/dist/node/html.d.ts.map +1 -1
- package/dist/node/html.js +75 -64
- package/dist/node/html.js.map +1 -1
- package/dist/node/index.d.ts +11 -11
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +8 -8
- package/dist/node/index.js.map +1 -1
- package/dist/node/init.d.ts +2 -0
- package/dist/node/init.d.ts.map +1 -1
- package/dist/node/init.js +59 -27
- package/dist/node/init.js.map +1 -1
- package/dist/node/lastUpdated.d.ts +2 -2
- package/dist/node/lastUpdated.d.ts.map +1 -1
- package/dist/node/lastUpdated.js +7 -4
- package/dist/node/lastUpdated.js.map +1 -1
- package/dist/node/loadSiteModule.js +2 -2
- package/dist/node/loadSiteModule.js.map +1 -1
- package/dist/node/markdown.d.ts +2 -2
- package/dist/node/markdown.d.ts.map +1 -1
- package/dist/node/markdown.js +110 -110
- package/dist/node/markdown.js.map +1 -1
- package/dist/node/markdownHeadings.d.ts +1 -1
- package/dist/node/markdownHeadings.d.ts.map +1 -1
- package/dist/node/markdownHeadings.js +11 -11
- package/dist/node/markdownHeadings.js.map +1 -1
- package/dist/node/markdownInclude.d.ts.map +1 -1
- package/dist/node/markdownInclude.js +11 -11
- package/dist/node/markdownInclude.js.map +1 -1
- package/dist/node/markdownSnippets.d.ts.map +1 -1
- package/dist/node/markdownSnippets.js +34 -34
- package/dist/node/markdownSnippets.js.map +1 -1
- package/dist/node/mdx.d.ts +1 -1
- package/dist/node/mdx.d.ts.map +1 -1
- package/dist/node/mdx.js +4 -4
- package/dist/node/mdx.js.map +1 -1
- package/dist/node/packageRoot.d.ts.map +1 -1
- package/dist/node/packageRoot.js +4 -4
- package/dist/node/packageRoot.js.map +1 -1
- package/dist/node/pageDataLoaders.d.ts +2 -2
- package/dist/node/pageDataLoaders.d.ts.map +1 -1
- package/dist/node/pageDataLoaders.js +24 -20
- package/dist/node/pageDataLoaders.js.map +1 -1
- package/dist/node/paths.d.ts.map +1 -1
- package/dist/node/paths.js +4 -4
- package/dist/node/paths.js.map +1 -1
- package/dist/node/plugin.d.ts +3 -3
- package/dist/node/plugin.d.ts.map +1 -1
- package/dist/node/plugin.js +66 -66
- package/dist/node/plugin.js.map +1 -1
- package/dist/node/resolveDeps.js +10 -10
- package/dist/node/resolveDeps.js.map +1 -1
- package/dist/node/serve.d.ts.map +1 -1
- package/dist/node/serve.js +13 -15
- package/dist/node/serve.js.map +1 -1
- package/dist/node/server.d.ts +3 -3
- package/dist/node/server.d.ts.map +1 -1
- package/dist/node/server.js +28 -25
- package/dist/node/server.js.map +1 -1
- package/dist/node/siteConfig.d.ts +12 -12
- package/dist/node/siteConfig.d.ts.map +1 -1
- package/dist/node/tagIndex.d.ts +5 -5
- package/dist/node/tagIndex.d.ts.map +1 -1
- package/dist/node/tagIndex.js +10 -10
- package/dist/node/tagIndex.js.map +1 -1
- package/dist/shared/contentChunk.d.ts.map +1 -1
- package/dist/shared/contentChunk.js +6 -6
- package/dist/shared/contentChunk.js.map +1 -1
- package/dist/shared/contentSchema.d.ts.map +1 -1
- package/dist/shared/contentSchema.js +11 -11
- package/dist/shared/contentSchema.js.map +1 -1
- package/dist/shared/deadLinks.d.ts.map +1 -1
- package/dist/shared/deadLinks.js +6 -6
- package/dist/shared/deadLinks.js.map +1 -1
- package/dist/shared/escapeHtml.js +4 -4
- package/dist/shared/escapeHtml.js.map +1 -1
- package/dist/shared/index.d.ts +14 -14
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +14 -14
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/locale.d.ts +1 -1
- package/dist/shared/locale.d.ts.map +1 -1
- package/dist/shared/locale.js +10 -10
- package/dist/shared/locale.js.map +1 -1
- package/dist/shared/pageChrome.d.ts +4 -4
- package/dist/shared/pageChrome.d.ts.map +1 -1
- package/dist/shared/pageChrome.js +21 -21
- package/dist/shared/pageChrome.js.map +1 -1
- package/dist/shared/pageHead.d.ts +1 -1
- package/dist/shared/pageHead.d.ts.map +1 -1
- package/dist/shared/pageHead.js +4 -4
- package/dist/shared/pageHead.js.map +1 -1
- package/dist/shared/pageMeta.d.ts +5 -5
- package/dist/shared/pageMeta.d.ts.map +1 -1
- package/dist/shared/pageMeta.js +15 -17
- package/dist/shared/pageMeta.js.map +1 -1
- package/dist/shared/rewrites.d.ts +1 -1
- package/dist/shared/rewrites.d.ts.map +1 -1
- package/dist/shared/rewrites.js +2 -2
- package/dist/shared/rewrites.js.map +1 -1
- package/dist/shared/route.js +5 -5
- package/dist/shared/route.js.map +1 -1
- package/dist/shared/scrollRestoration.d.ts +10 -0
- package/dist/shared/scrollRestoration.d.ts.map +1 -0
- package/dist/shared/scrollRestoration.js +66 -0
- package/dist/shared/scrollRestoration.js.map +1 -0
- package/dist/shared/search.d.ts +3 -3
- package/dist/shared/search.d.ts.map +1 -1
- package/dist/shared/search.js +18 -15
- package/dist/shared/search.js.map +1 -1
- package/dist/shared/sidebar.d.ts +1 -1
- package/dist/shared/sidebar.d.ts.map +1 -1
- package/dist/shared/sidebar.js +4 -4
- package/dist/shared/sidebar.js.map +1 -1
- package/dist/shared/slug.d.ts +1 -1
- package/dist/shared/slug.d.ts.map +1 -1
- package/dist/shared/slug.js +5 -5
- package/dist/shared/slug.js.map +1 -1
- package/dist/shared/socialIcons.d.ts.map +1 -1
- package/dist/shared/socialIcons.js +4 -4
- package/dist/shared/socialIcons.js.map +1 -1
- package/dist/shared/tags.js +8 -8
- package/dist/shared/tags.js.map +1 -1
- package/dist/shared/theme.d.ts +1 -1
- package/dist/shared/theme.d.ts.map +1 -1
- package/dist/shared/theme.js +16 -10
- package/dist/shared/theme.js.map +1 -1
- package/dist/shared/themeLabels.d.ts +1 -1
- package/dist/shared/themeLabels.d.ts.map +1 -1
- package/dist/shared/themeLabels.js +26 -26
- package/dist/shared/themeLabels.js.map +1 -1
- package/dist/shared/url.d.ts.map +1 -1
- package/dist/shared/url.js +3 -3
- package/dist/shared/url.js.map +1 -1
- package/package.json +33 -9
- package/src/client/app.tsx +111 -92
- package/src/client/entry-client.tsx +17 -19
- package/src/client/entry-ssr.tsx +33 -33
- package/src/client/index.ts +16 -2
- package/src/client/loadPage.ts +41 -38
- package/src/client/prefetchLinks.ts +30 -30
- package/src/client/theme-default/AlgoliaSearch.tsx +46 -46
- package/src/client/theme-default/Features.tsx +27 -21
- package/src/client/theme-default/Hero.tsx +22 -18
- package/src/client/theme-default/Layout.tsx +189 -244
- package/src/client/theme-default/Logo.tsx +30 -40
- package/src/client/theme-default/NavLinks.tsx +21 -21
- package/src/client/theme-default/SidebarNav.tsx +29 -29
- package/src/client/theme-default/SocialLinks.tsx +11 -11
- package/src/client/theme-default/ThemeToggle.tsx +2 -78
- package/src/client/theme-default/index.ts +1 -1
- package/src/client/theme-default/styles.css +30 -21
- package/src/client/theme-utils.tsx +184 -0
- package/src/client/types.ts +30 -24
- package/src/client/usePageHead.ts +128 -128
- package/src/client/useSiteSearch.ts +34 -34
- package/src/client/virtual.d.ts +76 -76
- package/src/shared/contentChunk.ts +6 -6
- package/src/shared/contentSchema.ts +52 -49
- package/src/shared/deadLinks.ts +16 -16
- package/src/shared/escapeHtml.ts +5 -5
- package/src/shared/index.ts +21 -25
- package/src/shared/locale.ts +46 -46
- package/src/shared/pageChrome.ts +123 -123
- package/src/shared/pageHead.ts +16 -16
- package/src/shared/pageMeta.ts +79 -79
- package/src/shared/rewrites.ts +14 -16
- package/src/shared/route.ts +7 -7
- package/src/shared/scrollRestoration.ts +70 -0
- package/src/shared/search.ts +56 -52
- package/src/shared/sidebar.ts +28 -28
- package/src/shared/slug.ts +13 -13
- package/src/shared/socialIcons.ts +12 -14
- package/src/shared/tags.ts +20 -20
- package/src/shared/theme.ts +22 -13
- package/src/shared/themeLabels.ts +45 -45
- package/src/shared/url.ts +6 -10
- package/templates/default/.preactpress/config.ts +17 -17
- package/templates/default/README.md +16 -16
- package/templates/default/guide/first-five-minutes.md +21 -21
- package/templates/default/index.html +1 -1
- package/templates/default/index.md +9 -9
- package/templates/default/package.json +1 -1
- package/templates/default/pnpm-lock.yaml +5 -5
- package/templates/docs/.preactpress/config.ts +76 -56
- package/templates/docs/README.md +6 -6
- package/templates/docs/components/BenefitsGrid.tsx +45 -0
- package/templates/docs/components/CliBlock.tsx +38 -0
- package/templates/docs/components/ComparisonTable.tsx +60 -0
- package/templates/docs/components/CopyableCommand.tsx +86 -0
- package/templates/docs/components/Counter.tsx +7 -5
- package/templates/docs/components/MarketingHero.tsx +63 -0
- package/templates/docs/components/MdxDemo.tsx +96 -0
- package/templates/docs/components/References.tsx +62 -0
- package/templates/docs/components/TemplateGallery.tsx +46 -0
- package/templates/docs/components/marketing.css +992 -0
- package/templates/docs/examples/algolia-docsearch.md +33 -0
- package/templates/docs/examples/content-loader.data.ts +11 -0
- package/templates/docs/examples/content-loader.md +29 -0
- package/templates/docs/examples/dynamic-routes.md +16 -0
- package/templates/docs/examples/static-assets.md +13 -0
- package/templates/docs/guide/advanced.md +4 -4
- package/templates/docs/guide/commands.md +10 -10
- package/templates/docs/guide/configuration.md +43 -43
- package/templates/docs/guide/creating-pages.md +60 -39
- package/templates/docs/guide/custom-themes.md +9 -9
- package/templates/docs/guide/deploy.md +29 -29
- package/templates/docs/guide/first-five-minutes.md +22 -22
- package/templates/docs/guide/getting-started.md +29 -31
- package/templates/docs/guide/markdown-and-mdx.md +1 -1
- package/templates/docs/guide/routing.md +40 -40
- package/templates/docs/guide/what-is-preactpress.md +18 -18
- package/templates/docs/index.html +1 -1
- package/templates/docs/index.mdx +25 -0
- package/templates/docs/interactive.mdx +1 -1
- package/templates/docs/markdown-examples.md +73 -21
- package/templates/docs/package.json +1 -1
- package/templates/docs/packages/[pkg].md +15 -0
- package/templates/docs/packages/[pkg].paths.ts +20 -0
- package/templates/docs/parts/include-body.md +1 -0
- package/templates/docs/pnpm-lock.yaml +5 -5
- package/templates/docs/public/preactpress-example.txt +1 -0
- package/templates/docs/snippets/greet.ts +1 -1
- package/templates/hono/.preactpress/config.ts +65 -65
- package/templates/hono/.preactpress/theme/CodeSnippet.tsx +15 -15
- package/templates/hono/.preactpress/theme/FeatureGrid.tsx +7 -7
- package/templates/hono/.preactpress/theme/Hero.tsx +13 -13
- package/templates/hono/.preactpress/theme/Layout.tsx +122 -164
- package/templates/hono/.preactpress/theme/Logo.tsx +6 -6
- package/templates/hono/.preactpress/theme/ThemeToggle.tsx +3 -70
- package/templates/hono/.preactpress/theme/hono.css +31 -14
- package/templates/hono/README.md +17 -15
- package/templates/hono/components/Counter.tsx +7 -5
- package/templates/hono/de/guide/configuration.md +18 -20
- package/templates/hono/de/guide/deploy.md +29 -29
- package/templates/hono/de/guide/first-five-minutes.md +21 -21
- package/templates/hono/de/guide/getting-started.md +29 -29
- package/templates/hono/de/guide/routing.md +26 -25
- package/templates/hono/de/guide/seiten-erstellen.md +39 -39
- package/templates/hono/de/guide/what-is-preactpress.md +18 -18
- package/templates/hono/de/index.mdx +20 -17
- package/templates/hono/de/interactive.mdx +1 -1
- package/templates/hono/de/markdown-examples.md +6 -6
- package/templates/hono/de/parts/include-body.md +1 -0
- package/templates/hono/de/snippets/greet.ts +1 -1
- package/templates/hono/guide/configuration.md +25 -25
- package/templates/hono/guide/creating-pages.md +39 -39
- package/templates/hono/guide/deploy.md +29 -29
- package/templates/hono/guide/first-five-minutes.md +21 -21
- package/templates/hono/guide/getting-started.md +29 -29
- package/templates/hono/guide/routing.md +40 -40
- package/templates/hono/guide/what-is-preactpress.md +18 -18
- package/templates/hono/index.html +1 -1
- package/templates/hono/index.mdx +21 -17
- package/templates/hono/interactive.mdx +1 -1
- package/templates/hono/markdown-examples.md +6 -6
- package/templates/hono/package.json +1 -1
- package/templates/hono/parts/include-body.md +1 -0
- package/templates/hono/pnpm-lock.yaml +5 -5
- package/templates/hono/snippets/greet.ts +1 -1
- package/templates/magazine/.preactpress/config.ts +19 -19
- package/templates/magazine/.preactpress/theme/Layout.tsx +69 -172
- package/templates/magazine/.preactpress/theme/TeaserGrid.tsx +14 -14
- package/templates/magazine/.preactpress/theme/ThemeToggle.tsx +4 -70
- package/templates/magazine/.preactpress/theme/magazine.css +13 -8
- package/templates/magazine/README.md +30 -0
- package/templates/magazine/article-markets.md +2 -2
- package/templates/magazine/article-tech.mdx +10 -10
- package/templates/magazine/index.data.ts +9 -9
- package/templates/magazine/index.html +5 -1
- package/templates/magazine/index.mdx +1 -1
- package/templates/magazine/package.json +1 -1
- package/templates/magazine/pnpm-lock.yaml +2917 -0
- package/templates/docs/about.md +0 -10
- package/templates/docs/dist/404.html +0 -29
- package/templates/docs/dist/about/index.html +0 -32
- package/templates/docs/dist/assets/esm-DzlBxN5p.js +0 -110
- package/templates/docs/dist/assets/interactive-64o6YwrR.js +0 -9
- package/templates/docs/dist/assets/interactive-BedCloEw.js +0 -9
- package/templates/docs/dist/assets/main-BVLeh8GO.js +0 -1
- package/templates/docs/dist/assets/main-CreUBb3N.js +0 -1
- package/templates/docs/dist/assets/main-oodK-zZy.css +0 -2
- package/templates/docs/dist/de/guide/getting-started/index.html +0 -36
- package/templates/docs/dist/de/guide/what-is-preactpress/index.html +0 -38
- package/templates/docs/dist/de/index.html +0 -29
- package/templates/docs/dist/favicon-32.png +0 -0
- package/templates/docs/dist/favicon.png +0 -0
- package/templates/docs/dist/favicon.svg +0 -28
- package/templates/docs/dist/guide/advanced/index.html +0 -53
- package/templates/docs/dist/guide/commands/index.html +0 -89
- package/templates/docs/dist/guide/configuration/index.html +0 -196
- package/templates/docs/dist/guide/creating-pages/index.html +0 -234
- package/templates/docs/dist/guide/custom-themes/index.html +0 -52
- package/templates/docs/dist/guide/default-theme/index.html +0 -53
- package/templates/docs/dist/guide/deploy/index.html +0 -195
- package/templates/docs/dist/guide/first-five-minutes/index.html +0 -99
- package/templates/docs/dist/guide/getting-started/index.html +0 -173
- package/templates/docs/dist/guide/markdown-and-mdx/index.html +0 -59
- package/templates/docs/dist/guide/routing/index.html +0 -192
- package/templates/docs/dist/guide/what-is-preactpress/index.html +0 -141
- package/templates/docs/dist/index.html +0 -30
- package/templates/docs/dist/interactive/index.html +0 -37
- package/templates/docs/dist/markdown-examples/index.html +0 -231
- package/templates/docs/dist/preactpress-content/404.json +0 -8
- package/templates/docs/dist/preactpress-content/_index.json +0 -50
- package/templates/docs/dist/preactpress-content/about.json +0 -15
- package/templates/docs/dist/preactpress-content/de.json +0 -45
- package/templates/docs/dist/preactpress-content/de__guide__getting-started.json +0 -26
- package/templates/docs/dist/preactpress-content/de__guide__what-is-preactpress.json +0 -21
- package/templates/docs/dist/preactpress-content/guide__advanced.json +0 -46
- package/templates/docs/dist/preactpress-content/guide__commands.json +0 -26
- package/templates/docs/dist/preactpress-content/guide__configuration.json +0 -51
- package/templates/docs/dist/preactpress-content/guide__creating-pages.json +0 -71
- package/templates/docs/dist/preactpress-content/guide__custom-themes.json +0 -15
- package/templates/docs/dist/preactpress-content/guide__default-theme.json +0 -36
- package/templates/docs/dist/preactpress-content/guide__deploy.json +0 -56
- package/templates/docs/dist/preactpress-content/guide__first-five-minutes.json +0 -36
- package/templates/docs/dist/preactpress-content/guide__getting-started.json +0 -51
- package/templates/docs/dist/preactpress-content/guide__markdown-and-mdx.json +0 -31
- package/templates/docs/dist/preactpress-content/guide__routing.json +0 -71
- package/templates/docs/dist/preactpress-content/guide__what-is-preactpress.json +0 -51
- package/templates/docs/dist/preactpress-content/markdown-examples.json +0 -71
- package/templates/docs/dist/preactpress-content/tags__markdown.json +0 -16
- package/templates/docs/dist/preactpress-search.json +0 -166
- package/templates/docs/dist/preactpress-theme.js +0 -1
- package/templates/docs/dist/tags/markdown/index.html +0 -32
- package/templates/docs/index.md +0 -28
- package/templates/hono/dist/404.html +0 -29
- package/templates/hono/dist/README/index.html +0 -104
- package/templates/hono/dist/about/index.html +0 -32
- package/templates/hono/dist/assets/Counter-CCEByS-J.js +0 -1
- package/templates/hono/dist/assets/Hero--o6WMNvm.js +0 -2
- package/templates/hono/dist/assets/de-D5r6Ye70.js +0 -10
- package/templates/hono/dist/assets/hono-BXWYYdyv.js +0 -10
- package/templates/hono/dist/assets/interactive-Bxo-WBpC.js +0 -9
- package/templates/hono/dist/assets/interactive-BznI4IQ3.js +0 -9
- package/templates/hono/dist/assets/main-Bqi-VFEk.js +0 -2
- package/templates/hono/dist/assets/main-DIIN7FO0.css +0 -1
- package/templates/hono/dist/de/about/index.html +0 -32
- package/templates/hono/dist/de/guide/commands/index.html +0 -41
- package/templates/hono/dist/de/guide/configuration/index.html +0 -105
- package/templates/hono/dist/de/guide/deploy/index.html +0 -195
- package/templates/hono/dist/de/guide/first-five-minutes/index.html +0 -99
- package/templates/hono/dist/de/guide/getting-started/index.html +0 -173
- package/templates/hono/dist/de/guide/routing/index.html +0 -165
- package/templates/hono/dist/de/guide/seiten-erstellen/index.html +0 -234
- package/templates/hono/dist/de/guide/what-is-preactpress/index.html +0 -141
- package/templates/hono/dist/de/index.html +0 -30
- package/templates/hono/dist/de/interactive/index.html +0 -37
- package/templates/hono/dist/de/markdown-examples/index.html +0 -97
- package/templates/hono/dist/de/parts/include-body/index.html +0 -36
- package/templates/hono/dist/de/tags/markdown/index.html +0 -32
- package/templates/hono/dist/favicon-32.png +0 -0
- package/templates/hono/dist/favicon.png +0 -0
- package/templates/hono/dist/favicon.svg +0 -28
- package/templates/hono/dist/guide/commands/index.html +0 -41
- package/templates/hono/dist/guide/configuration/index.html +0 -158
- package/templates/hono/dist/guide/creating-pages/index.html +0 -234
- package/templates/hono/dist/guide/deploy/index.html +0 -195
- package/templates/hono/dist/guide/first-five-minutes/index.html +0 -99
- package/templates/hono/dist/guide/getting-started/index.html +0 -173
- package/templates/hono/dist/guide/routing/index.html +0 -165
- package/templates/hono/dist/guide/what-is-preactpress/index.html +0 -141
- package/templates/hono/dist/index.html +0 -30
- package/templates/hono/dist/interactive/index.html +0 -37
- package/templates/hono/dist/markdown-examples/index.html +0 -105
- package/templates/hono/dist/partials/shared-note/index.html +0 -30
- package/templates/hono/dist/parts/include-body/index.html +0 -36
- package/templates/hono/dist/preactpress-content/404.json +0 -8
- package/templates/hono/dist/preactpress-content/README.json +0 -26
- package/templates/hono/dist/preactpress-content/about.json +0 -15
- package/templates/hono/dist/preactpress-content/de__about.json +0 -15
- package/templates/hono/dist/preactpress-content/de__guide__commands.json +0 -36
- package/templates/hono/dist/preactpress-content/de__guide__configuration.json +0 -41
- package/templates/hono/dist/preactpress-content/de__guide__deploy.json +0 -56
- package/templates/hono/dist/preactpress-content/de__guide__first-five-minutes.json +0 -36
- package/templates/hono/dist/preactpress-content/de__guide__getting-started.json +0 -51
- package/templates/hono/dist/preactpress-content/de__guide__routing.json +0 -61
- package/templates/hono/dist/preactpress-content/de__guide__seiten-erstellen.json +0 -71
- package/templates/hono/dist/preactpress-content/de__guide__what-is-preactpress.json +0 -51
- package/templates/hono/dist/preactpress-content/de__markdown-examples.json +0 -131
- package/templates/hono/dist/preactpress-content/de__parts__include-body.json +0 -16
- package/templates/hono/dist/preactpress-content/de__tags__markdown.json +0 -16
- package/templates/hono/dist/preactpress-content/guide__commands.json +0 -36
- package/templates/hono/dist/preactpress-content/guide__configuration.json +0 -51
- package/templates/hono/dist/preactpress-content/guide__creating-pages.json +0 -71
- package/templates/hono/dist/preactpress-content/guide__deploy.json +0 -56
- package/templates/hono/dist/preactpress-content/guide__first-five-minutes.json +0 -36
- package/templates/hono/dist/preactpress-content/guide__getting-started.json +0 -51
- package/templates/hono/dist/preactpress-content/guide__routing.json +0 -61
- package/templates/hono/dist/preactpress-content/guide__what-is-preactpress.json +0 -51
- package/templates/hono/dist/preactpress-content/markdown-examples.json +0 -141
- package/templates/hono/dist/preactpress-content/partials__shared-note.json +0 -10
- package/templates/hono/dist/preactpress-content/parts__include-body.json +0 -16
- package/templates/hono/dist/preactpress-content/tags__markdown.json +0 -16
- package/templates/hono/dist/preactpress-search.json +0 -242
- package/templates/hono/dist/preactpress-theme.js +0 -1
- package/templates/hono/dist/tags/markdown/index.html +0 -32
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Algolia DocSearch example
|
|
3
|
+
description: Configure the default theme to mount Algolia DocSearch instead of local search.
|
|
4
|
+
tags:
|
|
5
|
+
- examples
|
|
6
|
+
- search
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Algolia DocSearch example
|
|
10
|
+
|
|
11
|
+
The default theme can use local search (`search: true`) or Algolia DocSearch. Keep local search enabled until you have real DocSearch credentials; placeholder credentials intentionally fail `preactpress check`.
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { defineConfig } from "@kamod-ch/preactpress/config";
|
|
15
|
+
|
|
16
|
+
export default defineConfig({
|
|
17
|
+
themeConfig: {
|
|
18
|
+
search: {
|
|
19
|
+
provider: "algolia",
|
|
20
|
+
options: {
|
|
21
|
+
appId: "YOUR_APP_ID",
|
|
22
|
+
apiKey: "YOUR_SEARCH_API_KEY",
|
|
23
|
+
indexName: "YOUR_INDEX_NAME",
|
|
24
|
+
locales: {
|
|
25
|
+
de: { indexName: "YOUR_DE_INDEX_NAME" },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
When credentials are complete, the default theme renders the DocSearch button in the header and maps selected results back to PreactPress routes.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContentLoader } from "@kamod-ch/preactpress/config";
|
|
2
|
+
|
|
3
|
+
export default createContentLoader(["guide/*.md"], {
|
|
4
|
+
transform(items) {
|
|
5
|
+
return items.map((item) => ({
|
|
6
|
+
title: item.title,
|
|
7
|
+
route: item.route,
|
|
8
|
+
description: item.description,
|
|
9
|
+
}));
|
|
10
|
+
},
|
|
11
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Content loader example
|
|
3
|
+
description: A runnable createContentLoader example that collects guide metadata at build time.
|
|
4
|
+
tags:
|
|
5
|
+
- examples
|
|
6
|
+
- data
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Content loader example
|
|
10
|
+
|
|
11
|
+
This page has a matching `examples/content-loader.data.ts` module. During `preactpress build`, it collects guide pages and attaches the transformed result to this route's page data.
|
|
12
|
+
|
|
13
|
+
The default theme does not render `contentData` automatically, but custom themes can read it from `page.meta.contentData` just like the magazine starter does.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { createContentLoader } from "@kamod-ch/preactpress/config";
|
|
17
|
+
|
|
18
|
+
export default createContentLoader(["guide/*.md"], {
|
|
19
|
+
transform(items) {
|
|
20
|
+
return items.map((item) => ({
|
|
21
|
+
title: item.title,
|
|
22
|
+
route: item.route,
|
|
23
|
+
description: item.description,
|
|
24
|
+
}));
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Build this starter and inspect `dist/preactpress-content/examples/content-loader.json` to see the generated data payload.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Dynamic route example
|
|
3
|
+
description: Build multiple static pages from one bracket route template.
|
|
4
|
+
tags:
|
|
5
|
+
- examples
|
|
6
|
+
- dynamic-routes
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Dynamic route example
|
|
10
|
+
|
|
11
|
+
The docs starter includes a runnable dynamic route under `packages/[pkg].md`.
|
|
12
|
+
|
|
13
|
+
- [PreactPress package page](/packages/preactpress)
|
|
14
|
+
- [Preact package page](/packages/preact)
|
|
15
|
+
|
|
16
|
+
The matching `packages/[pkg].paths.ts` module returns the static params and props that are rendered at build time. No production server is required.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Static assets example
|
|
3
|
+
description: Serve files from the public directory with the generated static site.
|
|
4
|
+
tags:
|
|
5
|
+
- examples
|
|
6
|
+
- deploy
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Static assets example
|
|
10
|
+
|
|
11
|
+
Files in `public/` are copied to the root of `dist/` during `preactpress build`.
|
|
12
|
+
|
|
13
|
+
This starter includes [`/preactpress-example.txt`](/preactpress-example.txt) as a tiny public asset. Use this pattern for `robots.txt` overrides, downloads, images, and other files that should keep a stable URL.
|
|
@@ -8,12 +8,12 @@ description: Build hooks, data loaders, dynamic routes, MPA mode, and incrementa
|
|
|
8
8
|
Export an async factory when navigation or metadata comes from another system.
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
|
-
import { defineConfig } from
|
|
11
|
+
import { defineConfig } from "@kamod-ch/preactpress/config";
|
|
12
12
|
|
|
13
13
|
export default defineConfig(async () => ({
|
|
14
|
-
site: { title:
|
|
15
|
-
themeConfig: { sidebar: await loadSidebar() }
|
|
16
|
-
}))
|
|
14
|
+
site: { title: "CMS docs", description: "Generated navigation" },
|
|
15
|
+
themeConfig: { sidebar: await loadSidebar() },
|
|
16
|
+
}));
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Build hooks
|
|
@@ -5,16 +5,16 @@ description: Commands for scaffolding, development, validation, builds, and prev
|
|
|
5
5
|
|
|
6
6
|
Run commands from the site root or pass a root path as the final argument.
|
|
7
7
|
|
|
8
|
-
| Command
|
|
9
|
-
|
|
|
10
|
-
| `preactpress init [dir]`
|
|
11
|
-
| `preactpress init [dir] --template docs`
|
|
12
|
-
| `preactpress init [dir] --template magazine` | Scaffold a custom editorial theme
|
|
13
|
-
| `preactpress init [dir] --template hono`
|
|
14
|
-
| `preactpress dev [root]`
|
|
15
|
-
| `preactpress check [root]`
|
|
16
|
-
| `preactpress build [root]`
|
|
17
|
-
| `preactpress preview [root]`
|
|
8
|
+
| Command | Purpose |
|
|
9
|
+
| -------------------------------------------- | --------------------------------------------------- |
|
|
10
|
+
| `preactpress init [dir]` | Scaffold the minimal starter |
|
|
11
|
+
| `preactpress init [dir] --template docs` | Scaffold the full documentation starter |
|
|
12
|
+
| `preactpress init [dir] --template magazine` | Scaffold a custom editorial theme |
|
|
13
|
+
| `preactpress init [dir] --template hono` | Scaffold a product/docs custom theme |
|
|
14
|
+
| `preactpress dev [root]` | Start Vite SSR and hot reload |
|
|
15
|
+
| `preactpress check [root]` | Validate config, routes, links, locales, and drafts |
|
|
16
|
+
| `preactpress build [root]` | Emit static production files |
|
|
17
|
+
| `preactpress preview [root]` | Serve `outDir` locally |
|
|
18
18
|
|
|
19
19
|
## Recommended workflow
|
|
20
20
|
|
|
@@ -6,34 +6,34 @@ description: Complete reference for PreactPress site, theme, Markdown, build, an
|
|
|
6
6
|
Configuration lives in `.preactpress/config.ts`. A plain object works without imports; `defineConfig` adds type inference once PreactPress is installed.
|
|
7
7
|
|
|
8
8
|
```ts
|
|
9
|
-
import { defineConfig } from
|
|
9
|
+
import { defineConfig } from "@kamod-ch/preactpress/config";
|
|
10
10
|
|
|
11
11
|
export default defineConfig({
|
|
12
|
-
site: { title:
|
|
13
|
-
})
|
|
12
|
+
site: { title: "My docs", description: "Product documentation" },
|
|
13
|
+
});
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Top-level options
|
|
17
17
|
|
|
18
|
-
| Option
|
|
19
|
-
|
|
|
20
|
-
| `srcDir`
|
|
21
|
-
| `srcExclude`
|
|
22
|
-
| `outDir`
|
|
23
|
-
| `cacheDir`
|
|
24
|
-
| `cleanUrls`
|
|
25
|
-
| `rewrites`
|
|
26
|
-
| `ignoreDeadLinks` | Boolean, glob list, or callback used by `check`
|
|
27
|
-
| `mpa`
|
|
28
|
-
| `lastUpdatedGit`
|
|
29
|
-
| `theme`
|
|
30
|
-
| `site`
|
|
31
|
-
| `locales`
|
|
32
|
-
| `themeConfig`
|
|
33
|
-
| `markdown`
|
|
34
|
-
| `head`
|
|
35
|
-
| `vite`
|
|
36
|
-
| `build`
|
|
18
|
+
| Option | Purpose |
|
|
19
|
+
| ----------------- | ------------------------------------------------------------------ |
|
|
20
|
+
| `srcDir` | Content root, default `.` |
|
|
21
|
+
| `srcExclude` | Glob patterns that must not become pages |
|
|
22
|
+
| `outDir` | Static output directory, default `dist` |
|
|
23
|
+
| `cacheDir` | Incremental build cache directory |
|
|
24
|
+
| `cleanUrls` | Emit `path/index.html` when true |
|
|
25
|
+
| `rewrites` | Map public routes to existing content routes |
|
|
26
|
+
| `ignoreDeadLinks` | Boolean, glob list, or callback used by `check` |
|
|
27
|
+
| `mpa` | Remove client navigation from regular Markdown pages |
|
|
28
|
+
| `lastUpdatedGit` | Prefer git commit times for last-updated metadata |
|
|
29
|
+
| `theme` | Custom Preact layout module relative to `.preactpress` |
|
|
30
|
+
| `site` | Global title, description, language, URL, base, and title template |
|
|
31
|
+
| `locales` | Locale metadata and locale-specific theme settings |
|
|
32
|
+
| `themeConfig` | Default-theme navigation and page chrome |
|
|
33
|
+
| `markdown` | Markdown parser features |
|
|
34
|
+
| `head` | Global meta, link, and script tuples |
|
|
35
|
+
| `vite` | User Vite configuration merged into the internal config |
|
|
36
|
+
| `build` | Sitemap, robots, and feed output |
|
|
37
37
|
|
|
38
38
|
## Site metadata
|
|
39
39
|
|
|
@@ -52,19 +52,19 @@ Set `site.url` for canonical URLs, Open Graph, sitemap, robots, feeds, and local
|
|
|
52
52
|
|
|
53
53
|
## Theme options
|
|
54
54
|
|
|
55
|
-
| Option
|
|
56
|
-
|
|
|
57
|
-
| `logo`
|
|
58
|
-
| `labels`
|
|
59
|
-
| `nav`
|
|
60
|
-
| `sidebar`
|
|
61
|
-
| `outline`
|
|
62
|
-
| `search`
|
|
63
|
-
| `socialLinks` | Built-in or custom SVG social icons
|
|
64
|
-
| `tags`
|
|
65
|
-
| `footer`
|
|
66
|
-
| `editLink`
|
|
67
|
-
| `lastUpdated` | Show page timestamps
|
|
55
|
+
| Option | Purpose |
|
|
56
|
+
| ------------- | ----------------------------------------- |
|
|
57
|
+
| `logo` | URL or `{ light, dark }` image pair |
|
|
58
|
+
| `labels` | Override localized UI labels |
|
|
59
|
+
| `nav` | Header links and nested dropdowns |
|
|
60
|
+
| `sidebar` | Global groups or path-prefix map |
|
|
61
|
+
| `outline` | Enable or choose heading levels |
|
|
62
|
+
| `search` | Local search or Algolia DocSearch |
|
|
63
|
+
| `socialLinks` | Built-in or custom SVG social icons |
|
|
64
|
+
| `tags` | Show or hide page tag chips |
|
|
65
|
+
| `footer` | Site footer text |
|
|
66
|
+
| `editLink` | Repository edit URL pattern using `:path` |
|
|
67
|
+
| `lastUpdated` | Show page timestamps |
|
|
68
68
|
|
|
69
69
|
Available label keys are `skip`, `navigation`, `menu`, `closeMenu`, `search`, `filterPages`, `searchResults`, `previous`, `next`, `lastUpdated`, `onThisPage`, and `language`.
|
|
70
70
|
|
|
@@ -109,10 +109,10 @@ Import `defineConfig` from `@kamod-ch/preactpress/config` for typed site configu
|
|
|
109
109
|
For blogs and magazines, optional content-model helpers are available:
|
|
110
110
|
|
|
111
111
|
```ts
|
|
112
|
-
import { createContentLoader } from
|
|
113
|
-
import { articleFromFrontmatter, type ArticlePost } from
|
|
112
|
+
import { createContentLoader } from "@kamod-ch/preactpress/config";
|
|
113
|
+
import { articleFromFrontmatter, type ArticlePost } from "@kamod-ch/preactpress/shared";
|
|
114
114
|
|
|
115
|
-
export default createContentLoader<ArticlePost[]>([
|
|
115
|
+
export default createContentLoader<ArticlePost[]>(["posts/*.md"], {
|
|
116
116
|
transform(items) {
|
|
117
117
|
return items.map((item) =>
|
|
118
118
|
articleFromFrontmatter({
|
|
@@ -120,11 +120,11 @@ export default createContentLoader<ArticlePost[]>(['posts/*.md'], {
|
|
|
120
120
|
url: item.url,
|
|
121
121
|
title: item.title,
|
|
122
122
|
description: item.description,
|
|
123
|
-
frontmatter: item.frontmatter
|
|
124
|
-
})
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
})
|
|
123
|
+
frontmatter: item.frontmatter,
|
|
124
|
+
}),
|
|
125
|
+
);
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
Loader output is exposed on `page.meta.contentData` for the matching route.
|
|
@@ -40,14 +40,14 @@ Save the file — with `pnpm run dev` running, the page is immediately available
|
|
|
40
40
|
|
|
41
41
|
PreactPress uses **file-based routing**. The path relative to `srcDir` becomes the route:
|
|
42
42
|
|
|
43
|
-
| File
|
|
44
|
-
|
|
|
45
|
-
| `index.md`
|
|
46
|
-
| `about.md`
|
|
47
|
-
| `guide/intro.md`
|
|
48
|
-
| `guide/index.md`
|
|
43
|
+
| File | URL |
|
|
44
|
+
| -------------------- | ------------------ |
|
|
45
|
+
| `index.md` | `/` |
|
|
46
|
+
| `about.md` | `/about` |
|
|
47
|
+
| `guide/intro.md` | `/guide/intro` |
|
|
48
|
+
| `guide/index.md` | `/guide` |
|
|
49
49
|
| `news/2025/intro.md` | `/news/2025/intro` |
|
|
50
|
-
| `interactive.mdx`
|
|
50
|
+
| `interactive.mdx` | `/interactive` |
|
|
51
51
|
|
|
52
52
|
Production builds write directory indexes (`dist/about/index.html`) so URLs work without `.html`.
|
|
53
53
|
|
|
@@ -60,8 +60,8 @@ By default, Markdown files live in the project root next to `.preactpress/`. You
|
|
|
60
60
|
```ts
|
|
61
61
|
// .preactpress/config.ts
|
|
62
62
|
export default {
|
|
63
|
-
srcDir:
|
|
64
|
-
}
|
|
63
|
+
srcDir: "docs",
|
|
64
|
+
};
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
Then all pages live under `docs/` — e.g. `docs/index.md` → `/`, `docs/guide/foo.md` → `/guide/foo`. URLs stay the same; only the file location changes.
|
|
@@ -78,14 +78,14 @@ layout: doc
|
|
|
78
78
|
---
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
| Field
|
|
82
|
-
|
|
|
83
|
-
| `title`
|
|
84
|
-
| `description`
|
|
85
|
-
| `layout: doc`
|
|
86
|
-
| `layout: page` | Content page without sidebar or doc outline
|
|
87
|
-
| `layout: home` | Home layout with optional `hero` and `features`
|
|
88
|
-
| `draft: true`
|
|
81
|
+
| Field | Purpose |
|
|
82
|
+
| -------------- | ---------------------------------------------------------- |
|
|
83
|
+
| `title` | Page title (nav, `<title>`, search) |
|
|
84
|
+
| `description` | Summary for SEO and search |
|
|
85
|
+
| `layout: doc` | Docs layout with sidebar, outline, and previous/next links |
|
|
86
|
+
| `layout: page` | Content page without sidebar or doc outline |
|
|
87
|
+
| `layout: home` | Home layout with optional `hero` and `features` |
|
|
88
|
+
| `draft: true` | Excluded from build, sitemap, and search |
|
|
89
89
|
|
|
90
90
|
Additional fields (`tags`, `sidebar: false`, `navbar: false`, …) are documented in the package README and starter reference.
|
|
91
91
|
|
|
@@ -99,7 +99,7 @@ title: Demo
|
|
|
99
99
|
description: Interactive component
|
|
100
100
|
---
|
|
101
101
|
|
|
102
|
-
import Counter from
|
|
102
|
+
import Counter from "./components/Counter.tsx";
|
|
103
103
|
|
|
104
104
|
## Counter
|
|
105
105
|
|
|
@@ -110,6 +110,27 @@ Import components relative to the MDX file. `##` and `###` headings feed the on-
|
|
|
110
110
|
|
|
111
111
|
Example in this starter: [Interactive MDX](/interactive).
|
|
112
112
|
|
|
113
|
+
## Marketing pages with MDX
|
|
114
|
+
|
|
115
|
+
For a homepage or landing page that should use the default shell but custom section design, keep `layout: home`, disable the default Markdown prose styles, and add a page-specific class:
|
|
116
|
+
|
|
117
|
+
```mdx
|
|
118
|
+
---
|
|
119
|
+
layout: home
|
|
120
|
+
title: Product docs
|
|
121
|
+
sidebar: false
|
|
122
|
+
pageClass: product-home
|
|
123
|
+
markdownStyles: false
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
import "./components/product-home.css";
|
|
127
|
+
import ProductHero from "./components/ProductHero.tsx";
|
|
128
|
+
|
|
129
|
+
<ProductHero />
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`pageClass` gives your CSS a stable scope, while `markdownStyles: false` prevents default prose spacing from fighting custom sections. The docs starter homepage uses this pattern in [`index.mdx`](/).
|
|
133
|
+
|
|
113
134
|
## Add to navigation
|
|
114
135
|
|
|
115
136
|
New pages do **not** appear in the header or sidebar automatically. Register them in `.preactpress/config.ts`:
|
|
@@ -118,20 +139,20 @@ New pages do **not** appear in the header or sidebar automatically. Register the
|
|
|
118
139
|
export default {
|
|
119
140
|
themeConfig: {
|
|
120
141
|
nav: [
|
|
121
|
-
{ text:
|
|
122
|
-
{ text:
|
|
142
|
+
{ text: "Home", link: "/" },
|
|
143
|
+
{ text: "Contact", link: "/contact" },
|
|
123
144
|
],
|
|
124
145
|
sidebar: [
|
|
125
146
|
{
|
|
126
|
-
text:
|
|
147
|
+
text: "Guide",
|
|
127
148
|
items: [
|
|
128
|
-
{ text:
|
|
129
|
-
{ text:
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
]
|
|
133
|
-
}
|
|
134
|
-
}
|
|
149
|
+
{ text: "Creating pages", link: "/guide/creating-pages" },
|
|
150
|
+
{ text: "Contact", link: "/contact" },
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
};
|
|
135
156
|
```
|
|
136
157
|
|
|
137
158
|
For multilingual sites (`locales`), put `nav` and `sidebar` in each locale block — see [Getting Started](/guide/getting-started).
|
|
@@ -154,18 +175,18 @@ Each locale is a **separate file**, not an alias of the default page.
|
|
|
154
175
|
|
|
155
176
|
## Common issues
|
|
156
177
|
|
|
157
|
-
| Problem
|
|
158
|
-
|
|
|
159
|
-
| Page returns 404
|
|
160
|
-
| Markdown link broken
|
|
161
|
-
| Duplicate URL
|
|
162
|
-
| Page missing from nav | Add to `nav` / `sidebar` in config
|
|
178
|
+
| Problem | Fix |
|
|
179
|
+
| --------------------- | --------------------------------------------------------------------------- |
|
|
180
|
+
| Page returns 404 | `.md` / `.mdx` extension? File under `srcDir`? Dev server running? |
|
|
181
|
+
| Markdown link broken | Omit extension: `/guide/foo`, not `/guide/foo.md` |
|
|
182
|
+
| Duplicate URL | Two files must not map to the same route (e.g. `foo.md` and `foo/index.md`) |
|
|
183
|
+
| Page missing from nav | Add to `nav` / `sidebar` in config |
|
|
163
184
|
|
|
164
185
|
## Next steps
|
|
165
186
|
|
|
166
|
-
| Topic
|
|
167
|
-
|
|
|
187
|
+
| Topic | Link |
|
|
188
|
+
| -------------------------- | ------------------------------------------------- |
|
|
168
189
|
| First changes in 5 minutes | [Your first 5 minutes](/guide/first-five-minutes) |
|
|
169
|
-
| Routing, `srcDir`, tags
|
|
170
|
-
| Markdown syntax
|
|
171
|
-
| Production build
|
|
190
|
+
| Routing, `srcDir`, tags | [Routing](/guide/routing) |
|
|
191
|
+
| Markdown syntax | [Markdown examples](/markdown-examples) |
|
|
192
|
+
| Production build | [Deploy](/guide/deploy) |
|
|
@@ -7,31 +7,31 @@ Set `theme` to a TSX module relative to `.preactpress`:
|
|
|
7
7
|
|
|
8
8
|
```ts
|
|
9
9
|
export default {
|
|
10
|
-
theme:
|
|
11
|
-
}
|
|
10
|
+
theme: "./theme/Layout.tsx",
|
|
11
|
+
};
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
The module default-exports a Preact component receiving `LayoutProps` from `@kamod-ch/preactpress/client`.
|
|
15
15
|
|
|
16
16
|
```tsx
|
|
17
|
-
import type { FunctionalComponent } from
|
|
18
|
-
import type { LayoutProps } from
|
|
19
|
-
import
|
|
17
|
+
import type { FunctionalComponent } from "preact";
|
|
18
|
+
import type { LayoutProps } from "@kamod-ch/preactpress/client";
|
|
19
|
+
import "./theme.css";
|
|
20
20
|
|
|
21
21
|
const Layout: FunctionalComponent<LayoutProps> = ({ site, page }) => (
|
|
22
22
|
<div>
|
|
23
23
|
<header>{site.title}</header>
|
|
24
24
|
<main id="content">
|
|
25
|
-
{page?.kind ===
|
|
25
|
+
{page?.kind === "markdown" ? (
|
|
26
26
|
<article dangerouslySetInnerHTML={{ __html: page.html }} />
|
|
27
|
-
) : page?.kind ===
|
|
27
|
+
) : page?.kind === "mdx" ? (
|
|
28
28
|
<page.Component />
|
|
29
29
|
) : null}
|
|
30
30
|
</main>
|
|
31
31
|
</div>
|
|
32
|
-
)
|
|
32
|
+
);
|
|
33
33
|
|
|
34
|
-
export default Layout
|
|
34
|
+
export default Layout;
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
Theme authors are responsible for navigation, responsive behavior, focus management, search UI, and rendering Markdown versus MDX pages. Helpers for routes, page head data, tags, slugs, and theme state are exported from `@kamod-ch/preactpress/client` and `@kamod-ch/preactpress/shared`.
|
|
@@ -33,16 +33,16 @@ Set `site.url` before publishing. PreactPress uses it for canonical URLs, Open G
|
|
|
33
33
|
```ts
|
|
34
34
|
export default {
|
|
35
35
|
site: {
|
|
36
|
-
title:
|
|
37
|
-
description:
|
|
38
|
-
url:
|
|
39
|
-
base:
|
|
36
|
+
title: "My site",
|
|
37
|
+
description: "Short summary for search and social previews",
|
|
38
|
+
url: "https://example.com",
|
|
39
|
+
base: "/",
|
|
40
40
|
},
|
|
41
41
|
build: {
|
|
42
42
|
sitemap: true,
|
|
43
|
-
robots: true
|
|
44
|
-
}
|
|
45
|
-
}
|
|
43
|
+
robots: true,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
## Public base path
|
|
@@ -58,10 +58,10 @@ If the site is served from a subpath, set `site.base`:
|
|
|
58
58
|
```ts
|
|
59
59
|
export default {
|
|
60
60
|
site: {
|
|
61
|
-
url:
|
|
62
|
-
base:
|
|
63
|
-
}
|
|
64
|
-
}
|
|
61
|
+
url: "https://user.github.io",
|
|
62
|
+
base: "/my-repo/",
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
You can also override the base path for a single build:
|
|
@@ -74,15 +74,15 @@ pnpm exec preactpress build --base /my-repo/
|
|
|
74
74
|
|
|
75
75
|
The default output directory is `dist/`:
|
|
76
76
|
|
|
77
|
-
| Output
|
|
78
|
-
|
|
|
79
|
-
| `index.html`, `*/index.html` | Static HTML for each route
|
|
80
|
-
| `assets/*`
|
|
81
|
-
| `404.html`
|
|
82
|
-
| `preactpress-search.json`
|
|
77
|
+
| Output | Description |
|
|
78
|
+
| ---------------------------- | --------------------------------------------------- |
|
|
79
|
+
| `index.html`, `*/index.html` | Static HTML for each route |
|
|
80
|
+
| `assets/*` | Hashed JavaScript and CSS from Vite |
|
|
81
|
+
| `404.html` | Not-found page |
|
|
82
|
+
| `preactpress-search.json` | Search index for the default theme |
|
|
83
83
|
| `preactpress-content/*.json` | Lazy-loaded Markdown payloads for client navigation |
|
|
84
|
-
| `sitemap.xml`, `robots.txt`
|
|
85
|
-
| `feed.xml`
|
|
84
|
+
| `sitemap.xml`, `robots.txt` | Generated when `site.url` and build flags are set |
|
|
85
|
+
| `feed.xml` | Generated when `build.feed` is configured |
|
|
86
86
|
|
|
87
87
|
Deploy only the output directory. Do not deploy `node_modules`, `.preactpress`, or the build cache.
|
|
88
88
|
|
|
@@ -90,12 +90,12 @@ Deploy only the output directory. Do not deploy `node_modules`, `.preactpress`,
|
|
|
90
90
|
|
|
91
91
|
For most static hosts, use these settings:
|
|
92
92
|
|
|
93
|
-
| Host
|
|
94
|
-
|
|
|
95
|
-
| Netlify
|
|
96
|
-
| Vercel
|
|
97
|
-
| Cloudflare Pages
|
|
98
|
-
| Render Static Site | `pnpm run build` | `dist`
|
|
93
|
+
| Host | Build command | Output directory |
|
|
94
|
+
| ------------------ | ---------------- | ---------------- |
|
|
95
|
+
| Netlify | `pnpm run build` | `dist` |
|
|
96
|
+
| Vercel | `pnpm run build` | `dist` |
|
|
97
|
+
| Cloudflare Pages | `pnpm run build` | `dist` |
|
|
98
|
+
| Render Static Site | `pnpm run build` | `dist` |
|
|
99
99
|
|
|
100
100
|
Install command:
|
|
101
101
|
|
|
@@ -112,10 +112,10 @@ For a project site at `https://user.github.io/my-repo/`, configure:
|
|
|
112
112
|
```ts
|
|
113
113
|
export default {
|
|
114
114
|
site: {
|
|
115
|
-
url:
|
|
116
|
-
base:
|
|
117
|
-
}
|
|
118
|
-
}
|
|
115
|
+
url: "https://user.github.io",
|
|
116
|
+
base: "/my-repo/",
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
Then deploy the `dist/` directory.
|
|
@@ -14,10 +14,10 @@ Edit `.preactpress/config.ts`:
|
|
|
14
14
|
```ts
|
|
15
15
|
export default {
|
|
16
16
|
site: {
|
|
17
|
-
title:
|
|
18
|
-
description:
|
|
19
|
-
}
|
|
20
|
-
}
|
|
17
|
+
title: "My Docs",
|
|
18
|
+
description: "Short summary for search and social previews",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Save the file. The dev server picks up config changes on the next request.
|
|
@@ -41,7 +41,7 @@ PreactPress serves it at `/about`. Every `.md` or `.mdx` file under `srcDir` (de
|
|
|
41
41
|
|
|
42
42
|
Example: `news/2025/intro.md` → `/news/2025/intro`.
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Create the file in your project, save it, and you can open `/about` right away.
|
|
45
45
|
|
|
46
46
|
## 3. Add it to the navigation
|
|
47
47
|
|
|
@@ -49,34 +49,34 @@ In `.preactpress/config.ts`:
|
|
|
49
49
|
|
|
50
50
|
```ts
|
|
51
51
|
export default {
|
|
52
|
-
site: { title:
|
|
52
|
+
site: { title: "My Docs" },
|
|
53
53
|
themeConfig: {
|
|
54
54
|
nav: [
|
|
55
|
-
{ text:
|
|
56
|
-
{ text:
|
|
55
|
+
{ text: "Home", link: "/" },
|
|
56
|
+
{ text: "About", link: "/about" },
|
|
57
57
|
],
|
|
58
58
|
sidebar: [
|
|
59
59
|
{
|
|
60
|
-
text:
|
|
60
|
+
text: "Guide",
|
|
61
61
|
items: [
|
|
62
|
-
{ text:
|
|
63
|
-
{ text:
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
}
|
|
62
|
+
{ text: "Home", link: "/" },
|
|
63
|
+
{ text: "About", link: "/about" },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
Save — the dev server hot-reloads your changes.
|
|
72
72
|
|
|
73
73
|
## Next steps
|
|
74
74
|
|
|
75
|
-
| Command
|
|
76
|
-
|
|
|
77
|
-
| `pnpm run dev`
|
|
78
|
-
| `pnpm run check`
|
|
79
|
-
| `pnpm run build`
|
|
80
|
-
| `pnpm run preview` | Local preview of the build
|
|
75
|
+
| Command | Purpose |
|
|
76
|
+
| ------------------ | ---------------------------------- |
|
|
77
|
+
| `pnpm run dev` | Dev server with SSR and hot reload |
|
|
78
|
+
| `pnpm run check` | Validate config, links, and routes |
|
|
79
|
+
| `pnpm run build` | Static production build → `dist/` |
|
|
80
|
+
| `pnpm run preview` | Local preview of the build |
|
|
81
81
|
|
|
82
82
|
Before deploying, set `site.url` in config for canonical URLs, Open Graph tags, and `sitemap.xml`. Continue with [Routing](/guide/routing) to understand file-based routes, then [Deploy](/guide/deploy) for production build steps.
|