@kamod-ch/preactpress 1.0.0
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/LICENSE +21 -0
- package/README.md +165 -0
- package/assets/favicon-32.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/favicon.svg +28 -0
- package/assets/logo-dark.svg +5 -0
- package/assets/logo-light.svg +5 -0
- package/assets/logo.svg +5 -0
- package/bin/preactpress.mjs +13 -0
- package/dist/client/app.d.ts +6 -0
- package/dist/client/app.d.ts.map +1 -0
- package/dist/client/app.js +168 -0
- package/dist/client/app.js.map +1 -0
- package/dist/client/entry-client.d.ts +2 -0
- package/dist/client/entry-client.d.ts.map +1 -0
- package/dist/client/entry-client.js +27 -0
- package/dist/client/entry-client.js.map +1 -0
- package/dist/client/entry-ssr.d.ts +14 -0
- package/dist/client/entry-ssr.d.ts.map +1 -0
- package/dist/client/entry-ssr.js +59 -0
- package/dist/client/entry-ssr.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/loadPage.d.ts +5 -0
- package/dist/client/loadPage.d.ts.map +1 -0
- package/dist/client/loadPage.js +62 -0
- package/dist/client/loadPage.js.map +1 -0
- package/dist/client/prefetchLinks.d.ts +2 -0
- package/dist/client/prefetchLinks.d.ts.map +1 -0
- package/dist/client/prefetchLinks.js +55 -0
- package/dist/client/prefetchLinks.js.map +1 -0
- package/dist/client/theme-default/AlgoliaSearch.d.ts +12 -0
- package/dist/client/theme-default/AlgoliaSearch.d.ts.map +1 -0
- package/dist/client/theme-default/AlgoliaSearch.js +66 -0
- package/dist/client/theme-default/AlgoliaSearch.js.map +1 -0
- package/dist/client/theme-default/Features.d.ts +9 -0
- package/dist/client/theme-default/Features.d.ts.map +1 -0
- package/dist/client/theme-default/Features.js +25 -0
- package/dist/client/theme-default/Features.js.map +1 -0
- package/dist/client/theme-default/Hero.d.ts +9 -0
- package/dist/client/theme-default/Hero.d.ts.map +1 -0
- package/dist/client/theme-default/Hero.js +23 -0
- package/dist/client/theme-default/Hero.js.map +1 -0
- package/dist/client/theme-default/Layout.d.ts +6 -0
- package/dist/client/theme-default/Layout.d.ts.map +1 -0
- package/dist/client/theme-default/Layout.js +224 -0
- package/dist/client/theme-default/Layout.js.map +1 -0
- package/dist/client/theme-default/Logo.d.ts +16 -0
- package/dist/client/theme-default/Logo.d.ts.map +1 -0
- package/dist/client/theme-default/Logo.js +30 -0
- package/dist/client/theme-default/Logo.js.map +1 -0
- package/dist/client/theme-default/NavLinks.d.ts +12 -0
- package/dist/client/theme-default/NavLinks.d.ts.map +1 -0
- package/dist/client/theme-default/NavLinks.js +18 -0
- package/dist/client/theme-default/NavLinks.js.map +1 -0
- package/dist/client/theme-default/SidebarNav.d.ts +12 -0
- package/dist/client/theme-default/SidebarNav.d.ts.map +1 -0
- package/dist/client/theme-default/SidebarNav.js +21 -0
- package/dist/client/theme-default/SidebarNav.js.map +1 -0
- package/dist/client/theme-default/SocialLinks.d.ts +8 -0
- package/dist/client/theme-default/SocialLinks.d.ts.map +1 -0
- package/dist/client/theme-default/SocialLinks.js +13 -0
- package/dist/client/theme-default/SocialLinks.js.map +1 -0
- package/dist/client/theme-default/ThemeToggle.d.ts +4 -0
- package/dist/client/theme-default/ThemeToggle.d.ts.map +1 -0
- package/dist/client/theme-default/ThemeToggle.js +31 -0
- package/dist/client/theme-default/ThemeToggle.js.map +1 -0
- package/dist/client/theme-default/index.d.ts +2 -0
- package/dist/client/theme-default/index.d.ts.map +1 -0
- package/dist/client/theme-default/index.js +2 -0
- package/dist/client/theme-default/index.js.map +1 -0
- package/dist/client/types.d.ts +36 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +2 -0
- package/dist/client/types.js.map +1 -0
- package/dist/client/usePageHead.d.ts +10 -0
- package/dist/client/usePageHead.d.ts.map +1 -0
- package/dist/client/usePageHead.js +182 -0
- package/dist/client/usePageHead.js.map +1 -0
- package/dist/client/useSiteSearch.d.ts +10 -0
- package/dist/client/useSiteSearch.d.ts.map +1 -0
- package/dist/client/useSiteSearch.js +54 -0
- package/dist/client/useSiteSearch.js.map +1 -0
- package/dist/node/build.d.ts +15 -0
- package/dist/node/build.d.ts.map +1 -0
- package/dist/node/build.js +310 -0
- package/dist/node/build.js.map +1 -0
- package/dist/node/buildCache.d.ts +15 -0
- package/dist/node/buildCache.d.ts.map +1 -0
- package/dist/node/buildCache.js +41 -0
- package/dist/node/buildCache.js.map +1 -0
- package/dist/node/check.d.ts +11 -0
- package/dist/node/check.d.ts.map +1 -0
- package/dist/node/check.js +228 -0
- package/dist/node/check.js.map +1 -0
- package/dist/node/cli.d.ts +2 -0
- package/dist/node/cli.d.ts.map +1 -0
- package/dist/node/cli.js +157 -0
- package/dist/node/cli.js.map +1 -0
- package/dist/node/config-helpers.d.ts +8 -0
- package/dist/node/config-helpers.d.ts.map +1 -0
- package/dist/node/config-helpers.js +5 -0
- package/dist/node/config-helpers.js.map +1 -0
- package/dist/node/config.d.ts +13 -0
- package/dist/node/config.d.ts.map +1 -0
- package/dist/node/config.js +167 -0
- package/dist/node/config.js.map +1 -0
- package/dist/node/content.d.ts +16 -0
- package/dist/node/content.d.ts.map +1 -0
- package/dist/node/content.js +72 -0
- package/dist/node/content.js.map +1 -0
- package/dist/node/createContentLoader.d.ts +19 -0
- package/dist/node/createContentLoader.d.ts.map +1 -0
- package/dist/node/createContentLoader.js +11 -0
- package/dist/node/createContentLoader.js.map +1 -0
- package/dist/node/devCss.d.ts +7 -0
- package/dist/node/devCss.d.ts.map +1 -0
- package/dist/node/devCss.js +70 -0
- package/dist/node/devCss.js.map +1 -0
- package/dist/node/devSsr.d.ts +6 -0
- package/dist/node/devSsr.d.ts.map +1 -0
- package/dist/node/devSsr.js +112 -0
- package/dist/node/devSsr.js.map +1 -0
- package/dist/node/dynamicRoutes.d.ts +21 -0
- package/dist/node/dynamicRoutes.d.ts.map +1 -0
- package/dist/node/dynamicRoutes.js +120 -0
- package/dist/node/dynamicRoutes.js.map +1 -0
- package/dist/node/favicon.d.ts +9 -0
- package/dist/node/favicon.d.ts.map +1 -0
- package/dist/node/favicon.js +71 -0
- package/dist/node/favicon.js.map +1 -0
- package/dist/node/feed.d.ts +7 -0
- package/dist/node/feed.d.ts.map +1 -0
- package/dist/node/feed.js +37 -0
- package/dist/node/feed.js.map +1 -0
- package/dist/node/hooks.d.ts +9 -0
- package/dist/node/hooks.d.ts.map +1 -0
- package/dist/node/hooks.js +20 -0
- package/dist/node/hooks.js.map +1 -0
- package/dist/node/html.d.ts +56 -0
- package/dist/node/html.d.ts.map +1 -0
- package/dist/node/html.js +222 -0
- package/dist/node/html.js.map +1 -0
- package/dist/node/index.d.ts +12 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +9 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/init.d.ts +12 -0
- package/dist/node/init.d.ts.map +1 -0
- package/dist/node/init.js +93 -0
- package/dist/node/init.js.map +1 -0
- package/dist/node/lastUpdated.d.ts +3 -0
- package/dist/node/lastUpdated.d.ts.map +1 -0
- package/dist/node/lastUpdated.js +24 -0
- package/dist/node/lastUpdated.js.map +1 -0
- package/dist/node/loadSiteModule.d.ts +2 -0
- package/dist/node/loadSiteModule.d.ts.map +1 -0
- package/dist/node/loadSiteModule.js +10 -0
- package/dist/node/loadSiteModule.js.map +1 -0
- package/dist/node/markdown.d.ts +31 -0
- package/dist/node/markdown.d.ts.map +1 -0
- package/dist/node/markdown.js +508 -0
- package/dist/node/markdown.js.map +1 -0
- package/dist/node/markdownHeadings.d.ts +12 -0
- package/dist/node/markdownHeadings.d.ts.map +1 -0
- package/dist/node/markdownHeadings.js +70 -0
- package/dist/node/markdownHeadings.js.map +1 -0
- package/dist/node/markdownInclude.d.ts +6 -0
- package/dist/node/markdownInclude.d.ts.map +1 -0
- package/dist/node/markdownInclude.js +74 -0
- package/dist/node/markdownInclude.js.map +1 -0
- package/dist/node/markdownSnippets.d.ts +32 -0
- package/dist/node/markdownSnippets.d.ts.map +1 -0
- package/dist/node/markdownSnippets.js +172 -0
- package/dist/node/markdownSnippets.js.map +1 -0
- package/dist/node/mdx.d.ts +3 -0
- package/dist/node/mdx.d.ts.map +1 -0
- package/dist/node/mdx.js +9 -0
- package/dist/node/mdx.js.map +1 -0
- package/dist/node/packageRoot.d.ts +4 -0
- package/dist/node/packageRoot.d.ts.map +1 -0
- package/dist/node/packageRoot.js +7 -0
- package/dist/node/packageRoot.js.map +1 -0
- package/dist/node/pageDataLoaders.d.ts +6 -0
- package/dist/node/pageDataLoaders.d.ts.map +1 -0
- package/dist/node/pageDataLoaders.js +68 -0
- package/dist/node/pageDataLoaders.js.map +1 -0
- package/dist/node/paths.d.ts +5 -0
- package/dist/node/paths.d.ts.map +1 -0
- package/dist/node/paths.js +12 -0
- package/dist/node/paths.js.map +1 -0
- package/dist/node/plugin.d.ts +7 -0
- package/dist/node/plugin.d.ts.map +1 -0
- package/dist/node/plugin.js +282 -0
- package/dist/node/plugin.js.map +1 -0
- package/dist/node/resolveDeps.d.ts +5 -0
- package/dist/node/resolveDeps.d.ts.map +1 -0
- package/dist/node/resolveDeps.js +25 -0
- package/dist/node/resolveDeps.js.map +1 -0
- package/dist/node/serve.d.ts +6 -0
- package/dist/node/serve.d.ts.map +1 -0
- package/dist/node/serve.js +41 -0
- package/dist/node/serve.js.map +1 -0
- package/dist/node/server.d.ts +7 -0
- package/dist/node/server.d.ts.map +1 -0
- package/dist/node/server.js +55 -0
- package/dist/node/server.js.map +1 -0
- package/dist/node/siteConfig.d.ts +206 -0
- package/dist/node/siteConfig.d.ts.map +1 -0
- package/dist/node/siteConfig.js +2 -0
- package/dist/node/siteConfig.js.map +1 -0
- package/dist/node/tagIndex.d.ts +27 -0
- package/dist/node/tagIndex.d.ts.map +1 -0
- package/dist/node/tagIndex.js +84 -0
- package/dist/node/tagIndex.js.map +1 -0
- package/dist/shared/contentChunk.d.ts +4 -0
- package/dist/shared/contentChunk.d.ts.map +1 -0
- package/dist/shared/contentChunk.js +14 -0
- package/dist/shared/contentChunk.js.map +1 -0
- package/dist/shared/contentSchema.d.ts +43 -0
- package/dist/shared/contentSchema.d.ts.map +1 -0
- package/dist/shared/contentSchema.js +44 -0
- package/dist/shared/contentSchema.js.map +1 -0
- package/dist/shared/deadLinks.d.ts +9 -0
- package/dist/shared/deadLinks.d.ts.map +1 -0
- package/dist/shared/deadLinks.js +27 -0
- package/dist/shared/deadLinks.js.map +1 -0
- package/dist/shared/escapeHtml.d.ts +3 -0
- package/dist/shared/escapeHtml.d.ts.map +1 -0
- package/dist/shared/escapeHtml.js +11 -0
- package/dist/shared/escapeHtml.js.map +1 -0
- package/dist/shared/index.d.ts +15 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +15 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/locale.d.ts +11 -0
- package/dist/shared/locale.d.ts.map +1 -0
- package/dist/shared/locale.js +84 -0
- package/dist/shared/locale.js.map +1 -0
- package/dist/shared/pageChrome.d.ts +80 -0
- package/dist/shared/pageChrome.d.ts.map +1 -0
- package/dist/shared/pageChrome.js +160 -0
- package/dist/shared/pageChrome.js.map +1 -0
- package/dist/shared/pageHead.d.ts +3 -0
- package/dist/shared/pageHead.d.ts.map +1 -0
- package/dist/shared/pageHead.js +28 -0
- package/dist/shared/pageHead.js.map +1 -0
- package/dist/shared/pageMeta.d.ts +60 -0
- package/dist/shared/pageMeta.d.ts.map +1 -0
- package/dist/shared/pageMeta.js +72 -0
- package/dist/shared/pageMeta.js.map +1 -0
- package/dist/shared/rewrites.d.ts +5 -0
- package/dist/shared/rewrites.d.ts.map +1 -0
- package/dist/shared/rewrites.js +23 -0
- package/dist/shared/rewrites.js.map +1 -0
- package/dist/shared/route.d.ts +5 -0
- package/dist/shared/route.d.ts.map +1 -0
- package/dist/shared/route.js +15 -0
- package/dist/shared/route.js.map +1 -0
- package/dist/shared/search.d.ts +39 -0
- package/dist/shared/search.d.ts.map +1 -0
- package/dist/shared/search.js +63 -0
- package/dist/shared/search.js.map +1 -0
- package/dist/shared/sidebar.d.ts +18 -0
- package/dist/shared/sidebar.d.ts.map +1 -0
- package/dist/shared/sidebar.js +51 -0
- package/dist/shared/sidebar.js.map +1 -0
- package/dist/shared/slug.d.ts +4 -0
- package/dist/shared/slug.d.ts.map +1 -0
- package/dist/shared/slug.js +21 -0
- package/dist/shared/slug.js.map +1 -0
- package/dist/shared/socialIcons.d.ts +13 -0
- package/dist/shared/socialIcons.d.ts.map +1 -0
- package/dist/shared/socialIcons.js +27 -0
- package/dist/shared/socialIcons.js.map +1 -0
- package/dist/shared/tags.d.ts +6 -0
- package/dist/shared/tags.d.ts.map +1 -0
- package/dist/shared/tags.js +39 -0
- package/dist/shared/tags.js.map +1 -0
- package/dist/shared/theme.d.ts +8 -0
- package/dist/shared/theme.d.ts.map +1 -0
- package/dist/shared/theme.js +25 -0
- package/dist/shared/theme.js.map +1 -0
- package/dist/shared/themeLabels.d.ts +18 -0
- package/dist/shared/themeLabels.d.ts.map +1 -0
- package/dist/shared/themeLabels.js +51 -0
- package/dist/shared/themeLabels.js.map +1 -0
- package/dist/shared/url.d.ts +7 -0
- package/dist/shared/url.d.ts.map +1 -0
- package/dist/shared/url.js +10 -0
- package/dist/shared/url.js.map +1 -0
- package/package.json +108 -0
- package/src/client/app.tsx +194 -0
- package/src/client/entry-client.tsx +27 -0
- package/src/client/entry-ssr.tsx +77 -0
- package/src/client/index.ts +2 -0
- package/src/client/loadPage.ts +68 -0
- package/src/client/prefetchLinks.ts +60 -0
- package/src/client/theme-default/AlgoliaSearch.tsx +89 -0
- package/src/client/theme-default/Features.tsx +75 -0
- package/src/client/theme-default/Hero.tsx +60 -0
- package/src/client/theme-default/Layout.tsx +525 -0
- package/src/client/theme-default/Logo.tsx +104 -0
- package/src/client/theme-default/NavLinks.tsx +65 -0
- package/src/client/theme-default/SidebarNav.tsx +103 -0
- package/src/client/theme-default/SocialLinks.tsx +41 -0
- package/src/client/theme-default/ThemeToggle.tsx +79 -0
- package/src/client/theme-default/index.ts +1 -0
- package/src/client/theme-default/styles.css +1450 -0
- package/src/client/types.ts +37 -0
- package/src/client/usePageHead.ts +212 -0
- package/src/client/useSiteSearch.ts +57 -0
- package/src/client/virtual.d.ts +103 -0
- package/src/shared/contentChunk.ts +14 -0
- package/src/shared/contentSchema.ts +85 -0
- package/src/shared/deadLinks.ts +33 -0
- package/src/shared/escapeHtml.ts +11 -0
- package/src/shared/index.ts +83 -0
- package/src/shared/locale.ts +116 -0
- package/src/shared/pageChrome.ts +244 -0
- package/src/shared/pageHead.ts +26 -0
- package/src/shared/pageMeta.ts +136 -0
- package/src/shared/rewrites.ts +35 -0
- package/src/shared/route.ts +14 -0
- package/src/shared/search.ts +105 -0
- package/src/shared/sidebar.ts +67 -0
- package/src/shared/slug.ts +23 -0
- package/src/shared/socialIcons.ts +44 -0
- package/src/shared/tags.ts +36 -0
- package/src/shared/theme.ts +26 -0
- package/src/shared/themeLabels.ts +72 -0
- package/src/shared/url.ts +14 -0
- package/templates/default/.preactpress/config.ts +31 -0
- package/templates/default/README.md +45 -0
- package/templates/default/about.md +11 -0
- package/templates/default/guide/first-five-minutes.md +83 -0
- package/templates/default/index.html +18 -0
- package/templates/default/index.md +55 -0
- package/templates/default/package.json +15 -0
- package/templates/default/pnpm-lock.yaml +2917 -0
- package/templates/docs/.preactpress/config.ts +94 -0
- package/templates/docs/README.md +21 -0
- package/templates/docs/about.md +10 -0
- package/templates/docs/components/Counter.tsx +25 -0
- package/templates/docs/de/guide/getting-started.md +19 -0
- package/templates/docs/de/guide/what-is-preactpress.md +15 -0
- package/templates/docs/de/index.md +23 -0
- package/templates/docs/dist/404.html +29 -0
- package/templates/docs/dist/about/index.html +32 -0
- package/templates/docs/dist/assets/esm-DzlBxN5p.js +110 -0
- package/templates/docs/dist/assets/interactive-64o6YwrR.js +9 -0
- package/templates/docs/dist/assets/interactive-BedCloEw.js +9 -0
- package/templates/docs/dist/assets/main-BVLeh8GO.js +1 -0
- package/templates/docs/dist/assets/main-CreUBb3N.js +1 -0
- package/templates/docs/dist/assets/main-oodK-zZy.css +2 -0
- package/templates/docs/dist/de/guide/getting-started/index.html +36 -0
- package/templates/docs/dist/de/guide/what-is-preactpress/index.html +38 -0
- package/templates/docs/dist/de/index.html +29 -0
- package/templates/docs/dist/favicon-32.png +0 -0
- package/templates/docs/dist/favicon.png +0 -0
- package/templates/docs/dist/favicon.svg +28 -0
- package/templates/docs/dist/guide/advanced/index.html +53 -0
- package/templates/docs/dist/guide/commands/index.html +89 -0
- package/templates/docs/dist/guide/configuration/index.html +196 -0
- package/templates/docs/dist/guide/creating-pages/index.html +234 -0
- package/templates/docs/dist/guide/custom-themes/index.html +52 -0
- package/templates/docs/dist/guide/default-theme/index.html +53 -0
- package/templates/docs/dist/guide/deploy/index.html +195 -0
- package/templates/docs/dist/guide/first-five-minutes/index.html +99 -0
- package/templates/docs/dist/guide/getting-started/index.html +173 -0
- package/templates/docs/dist/guide/markdown-and-mdx/index.html +59 -0
- package/templates/docs/dist/guide/routing/index.html +192 -0
- package/templates/docs/dist/guide/what-is-preactpress/index.html +141 -0
- package/templates/docs/dist/index.html +30 -0
- package/templates/docs/dist/interactive/index.html +37 -0
- package/templates/docs/dist/markdown-examples/index.html +231 -0
- package/templates/docs/dist/preactpress-content/404.json +8 -0
- package/templates/docs/dist/preactpress-content/_index.json +50 -0
- package/templates/docs/dist/preactpress-content/about.json +15 -0
- package/templates/docs/dist/preactpress-content/de.json +45 -0
- package/templates/docs/dist/preactpress-content/de__guide__getting-started.json +26 -0
- package/templates/docs/dist/preactpress-content/de__guide__what-is-preactpress.json +21 -0
- package/templates/docs/dist/preactpress-content/guide__advanced.json +46 -0
- package/templates/docs/dist/preactpress-content/guide__commands.json +26 -0
- package/templates/docs/dist/preactpress-content/guide__configuration.json +51 -0
- package/templates/docs/dist/preactpress-content/guide__creating-pages.json +71 -0
- package/templates/docs/dist/preactpress-content/guide__custom-themes.json +15 -0
- package/templates/docs/dist/preactpress-content/guide__default-theme.json +36 -0
- package/templates/docs/dist/preactpress-content/guide__deploy.json +56 -0
- package/templates/docs/dist/preactpress-content/guide__first-five-minutes.json +36 -0
- package/templates/docs/dist/preactpress-content/guide__getting-started.json +51 -0
- package/templates/docs/dist/preactpress-content/guide__markdown-and-mdx.json +31 -0
- package/templates/docs/dist/preactpress-content/guide__routing.json +71 -0
- package/templates/docs/dist/preactpress-content/guide__what-is-preactpress.json +51 -0
- package/templates/docs/dist/preactpress-content/markdown-examples.json +71 -0
- package/templates/docs/dist/preactpress-content/tags__markdown.json +16 -0
- package/templates/docs/dist/preactpress-search.json +166 -0
- package/templates/docs/dist/preactpress-theme.js +1 -0
- package/templates/docs/dist/tags/markdown/index.html +32 -0
- package/templates/docs/guide/advanced.md +44 -0
- package/templates/docs/guide/commands.md +41 -0
- package/templates/docs/guide/configuration.md +130 -0
- package/templates/docs/guide/creating-pages.md +171 -0
- package/templates/docs/guide/custom-themes.md +39 -0
- package/templates/docs/guide/default-theme.md +41 -0
- package/templates/docs/guide/deploy.md +197 -0
- package/templates/docs/guide/first-five-minutes.md +82 -0
- package/templates/docs/guide/getting-started.md +146 -0
- package/templates/docs/guide/markdown-and-mdx.md +59 -0
- package/templates/docs/guide/routing.md +263 -0
- package/templates/docs/guide/what-is-preactpress.md +87 -0
- package/templates/docs/index.html +18 -0
- package/templates/docs/index.md +28 -0
- package/templates/docs/interactive.mdx +32 -0
- package/templates/docs/markdown-examples.md +72 -0
- package/templates/docs/package.json +15 -0
- package/templates/docs/partials/shared-note.md +3 -0
- package/templates/docs/parts/include-body.md +9 -0
- package/templates/docs/pnpm-lock.yaml +2917 -0
- package/templates/docs/snippets/greet.ts +3 -0
- package/templates/hono/.preactpress/config.ts +100 -0
- package/templates/hono/.preactpress/theme/CodeSnippet.tsx +41 -0
- package/templates/hono/.preactpress/theme/FeatureGrid.tsx +27 -0
- package/templates/hono/.preactpress/theme/Hero.tsx +45 -0
- package/templates/hono/.preactpress/theme/Layout.tsx +388 -0
- package/templates/hono/.preactpress/theme/Logo.tsx +26 -0
- package/templates/hono/.preactpress/theme/ThemeToggle.tsx +72 -0
- package/templates/hono/.preactpress/theme/hono.css +1058 -0
- package/templates/hono/README.md +41 -0
- package/templates/hono/about.md +10 -0
- package/templates/hono/components/Counter.tsx +25 -0
- package/templates/hono/de/about.md +10 -0
- package/templates/hono/de/guide/commands.md +44 -0
- package/templates/hono/de/guide/configuration.md +64 -0
- package/templates/hono/de/guide/deploy.md +197 -0
- package/templates/hono/de/guide/first-five-minutes.md +82 -0
- package/templates/hono/de/guide/getting-started.md +146 -0
- package/templates/hono/de/guide/routing.md +220 -0
- package/templates/hono/de/guide/seiten-erstellen.md +171 -0
- package/templates/hono/de/guide/what-is-preactpress.md +87 -0
- package/templates/hono/de/index.mdx +51 -0
- package/templates/hono/de/interactive.mdx +32 -0
- package/templates/hono/de/markdown-examples.md +142 -0
- package/templates/hono/de/parts/include-body.md +9 -0
- package/templates/hono/de/snippets/greet.ts +3 -0
- package/templates/hono/dist/404.html +29 -0
- package/templates/hono/dist/README/index.html +104 -0
- package/templates/hono/dist/about/index.html +32 -0
- package/templates/hono/dist/assets/Counter-CCEByS-J.js +1 -0
- package/templates/hono/dist/assets/Hero--o6WMNvm.js +2 -0
- package/templates/hono/dist/assets/de-D5r6Ye70.js +10 -0
- package/templates/hono/dist/assets/hono-BXWYYdyv.js +10 -0
- package/templates/hono/dist/assets/interactive-Bxo-WBpC.js +9 -0
- package/templates/hono/dist/assets/interactive-BznI4IQ3.js +9 -0
- package/templates/hono/dist/assets/main-Bqi-VFEk.js +2 -0
- package/templates/hono/dist/assets/main-DIIN7FO0.css +1 -0
- package/templates/hono/dist/de/about/index.html +32 -0
- package/templates/hono/dist/de/guide/commands/index.html +41 -0
- package/templates/hono/dist/de/guide/configuration/index.html +105 -0
- package/templates/hono/dist/de/guide/deploy/index.html +195 -0
- package/templates/hono/dist/de/guide/first-five-minutes/index.html +99 -0
- package/templates/hono/dist/de/guide/getting-started/index.html +173 -0
- package/templates/hono/dist/de/guide/routing/index.html +165 -0
- package/templates/hono/dist/de/guide/seiten-erstellen/index.html +234 -0
- package/templates/hono/dist/de/guide/what-is-preactpress/index.html +141 -0
- package/templates/hono/dist/de/index.html +30 -0
- package/templates/hono/dist/de/interactive/index.html +37 -0
- package/templates/hono/dist/de/markdown-examples/index.html +97 -0
- package/templates/hono/dist/de/parts/include-body/index.html +36 -0
- package/templates/hono/dist/de/tags/markdown/index.html +32 -0
- package/templates/hono/dist/favicon-32.png +0 -0
- package/templates/hono/dist/favicon.png +0 -0
- package/templates/hono/dist/favicon.svg +28 -0
- package/templates/hono/dist/guide/commands/index.html +41 -0
- package/templates/hono/dist/guide/configuration/index.html +158 -0
- package/templates/hono/dist/guide/creating-pages/index.html +234 -0
- package/templates/hono/dist/guide/deploy/index.html +195 -0
- package/templates/hono/dist/guide/first-five-minutes/index.html +99 -0
- package/templates/hono/dist/guide/getting-started/index.html +173 -0
- package/templates/hono/dist/guide/routing/index.html +165 -0
- package/templates/hono/dist/guide/what-is-preactpress/index.html +141 -0
- package/templates/hono/dist/index.html +30 -0
- package/templates/hono/dist/interactive/index.html +37 -0
- package/templates/hono/dist/markdown-examples/index.html +105 -0
- package/templates/hono/dist/partials/shared-note/index.html +30 -0
- package/templates/hono/dist/parts/include-body/index.html +36 -0
- package/templates/hono/dist/preactpress-content/404.json +8 -0
- package/templates/hono/dist/preactpress-content/README.json +26 -0
- package/templates/hono/dist/preactpress-content/about.json +15 -0
- package/templates/hono/dist/preactpress-content/de__about.json +15 -0
- package/templates/hono/dist/preactpress-content/de__guide__commands.json +36 -0
- package/templates/hono/dist/preactpress-content/de__guide__configuration.json +41 -0
- package/templates/hono/dist/preactpress-content/de__guide__deploy.json +56 -0
- package/templates/hono/dist/preactpress-content/de__guide__first-five-minutes.json +36 -0
- package/templates/hono/dist/preactpress-content/de__guide__getting-started.json +51 -0
- package/templates/hono/dist/preactpress-content/de__guide__routing.json +61 -0
- package/templates/hono/dist/preactpress-content/de__guide__seiten-erstellen.json +71 -0
- package/templates/hono/dist/preactpress-content/de__guide__what-is-preactpress.json +51 -0
- package/templates/hono/dist/preactpress-content/de__markdown-examples.json +131 -0
- package/templates/hono/dist/preactpress-content/de__parts__include-body.json +16 -0
- package/templates/hono/dist/preactpress-content/de__tags__markdown.json +16 -0
- package/templates/hono/dist/preactpress-content/guide__commands.json +36 -0
- package/templates/hono/dist/preactpress-content/guide__configuration.json +51 -0
- package/templates/hono/dist/preactpress-content/guide__creating-pages.json +71 -0
- package/templates/hono/dist/preactpress-content/guide__deploy.json +56 -0
- package/templates/hono/dist/preactpress-content/guide__first-five-minutes.json +36 -0
- package/templates/hono/dist/preactpress-content/guide__getting-started.json +51 -0
- package/templates/hono/dist/preactpress-content/guide__routing.json +61 -0
- package/templates/hono/dist/preactpress-content/guide__what-is-preactpress.json +51 -0
- package/templates/hono/dist/preactpress-content/markdown-examples.json +141 -0
- package/templates/hono/dist/preactpress-content/partials__shared-note.json +10 -0
- package/templates/hono/dist/preactpress-content/parts__include-body.json +16 -0
- package/templates/hono/dist/preactpress-content/tags__markdown.json +16 -0
- package/templates/hono/dist/preactpress-search.json +242 -0
- package/templates/hono/dist/preactpress-theme.js +1 -0
- package/templates/hono/dist/tags/markdown/index.html +32 -0
- package/templates/hono/guide/commands.md +44 -0
- package/templates/hono/guide/configuration.md +177 -0
- package/templates/hono/guide/creating-pages.md +171 -0
- package/templates/hono/guide/deploy.md +197 -0
- package/templates/hono/guide/first-five-minutes.md +82 -0
- package/templates/hono/guide/getting-started.md +146 -0
- package/templates/hono/guide/routing.md +263 -0
- package/templates/hono/guide/what-is-preactpress.md +87 -0
- package/templates/hono/index.html +18 -0
- package/templates/hono/index.mdx +51 -0
- package/templates/hono/interactive.mdx +32 -0
- package/templates/hono/markdown-examples.md +160 -0
- package/templates/hono/package.json +15 -0
- package/templates/hono/partials/shared-note.md +3 -0
- package/templates/hono/parts/include-body.md +9 -0
- package/templates/hono/pnpm-lock.yaml +2917 -0
- package/templates/hono/snippets/greet.ts +3 -0
- package/templates/magazine/.preactpress/config.ts +36 -0
- package/templates/magazine/.preactpress/theme/Layout.tsx +319 -0
- package/templates/magazine/.preactpress/theme/TeaserGrid.tsx +39 -0
- package/templates/magazine/.preactpress/theme/ThemeToggle.tsx +73 -0
- package/templates/magazine/.preactpress/theme/magazine.css +587 -0
- package/templates/magazine/article-markets.md +24 -0
- package/templates/magazine/article-tech.mdx +35 -0
- package/templates/magazine/index.data.ts +19 -0
- package/templates/magazine/index.html +14 -0
- package/templates/magazine/index.mdx +13 -0
- package/templates/magazine/package.json +15 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Deploy
|
|
3
|
+
description: Build and publish a PreactPress site
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Deploy
|
|
7
|
+
|
|
8
|
+
PreactPress builds static files. Production deployment means running a build and uploading the output directory, usually `dist/`, to a static host.
|
|
9
|
+
|
|
10
|
+
No Node server is required in production.
|
|
11
|
+
|
|
12
|
+
## Build and test locally
|
|
13
|
+
|
|
14
|
+
Run the release checks and production build from your site directory:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm run check
|
|
18
|
+
pnpm run build
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Preview the build locally:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm run preview
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The preview server serves the built output at **http://localhost:4173** by default.
|
|
28
|
+
|
|
29
|
+
## Configure production metadata
|
|
30
|
+
|
|
31
|
+
Set `site.url` before publishing. PreactPress uses it for canonical URLs, Open Graph metadata, `sitemap.xml`, and `robots.txt`.
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
export default {
|
|
35
|
+
site: {
|
|
36
|
+
title: 'My site',
|
|
37
|
+
description: 'Short summary for search and social previews',
|
|
38
|
+
url: 'https://example.com',
|
|
39
|
+
base: '/'
|
|
40
|
+
},
|
|
41
|
+
build: {
|
|
42
|
+
sitemap: true,
|
|
43
|
+
robots: true
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Public base path
|
|
49
|
+
|
|
50
|
+
By default, PreactPress assumes your site is served at the domain root:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
https://example.com/
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
If the site is served from a subpath, set `site.base`:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
export default {
|
|
60
|
+
site: {
|
|
61
|
+
url: 'https://user.github.io',
|
|
62
|
+
base: '/my-repo/'
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
You can also override the base path for a single build:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pnpm exec preactpress build --base /my-repo/
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Build output
|
|
74
|
+
|
|
75
|
+
The default output directory is `dist/`:
|
|
76
|
+
|
|
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
|
+
| `preactpress-content/*.json` | Lazy-loaded Markdown payloads for client navigation |
|
|
84
|
+
| `sitemap.xml`, `robots.txt` | Generated when `site.url` and build flags are set |
|
|
85
|
+
| `feed.xml` | Generated when `build.feed` is configured |
|
|
86
|
+
|
|
87
|
+
Deploy only the output directory. Do not deploy `node_modules`, `.preactpress`, or the build cache.
|
|
88
|
+
|
|
89
|
+
## Platform settings
|
|
90
|
+
|
|
91
|
+
For most static hosts, use these settings:
|
|
92
|
+
|
|
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
|
+
|
|
100
|
+
Install command:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pnpm install
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Node version: **20 or higher**.
|
|
107
|
+
|
|
108
|
+
## GitHub Pages
|
|
109
|
+
|
|
110
|
+
For a project site at `https://user.github.io/my-repo/`, configure:
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
export default {
|
|
114
|
+
site: {
|
|
115
|
+
url: 'https://user.github.io',
|
|
116
|
+
base: '/my-repo/'
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Then deploy the `dist/` directory.
|
|
122
|
+
|
|
123
|
+
A minimal GitHub Actions workflow can look like this:
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
name: Deploy PreactPress site to Pages
|
|
127
|
+
|
|
128
|
+
on:
|
|
129
|
+
push:
|
|
130
|
+
branches: [main]
|
|
131
|
+
workflow_dispatch:
|
|
132
|
+
|
|
133
|
+
permissions:
|
|
134
|
+
contents: read
|
|
135
|
+
pages: write
|
|
136
|
+
id-token: write
|
|
137
|
+
|
|
138
|
+
concurrency:
|
|
139
|
+
group: pages
|
|
140
|
+
cancel-in-progress: false
|
|
141
|
+
|
|
142
|
+
jobs:
|
|
143
|
+
build:
|
|
144
|
+
runs-on: ubuntu-latest
|
|
145
|
+
steps:
|
|
146
|
+
- uses: actions/checkout@v4
|
|
147
|
+
- uses: pnpm/action-setup@v4
|
|
148
|
+
- uses: actions/setup-node@v4
|
|
149
|
+
with:
|
|
150
|
+
node-version: 22
|
|
151
|
+
cache: pnpm
|
|
152
|
+
- uses: actions/configure-pages@v5
|
|
153
|
+
- run: pnpm install
|
|
154
|
+
- run: pnpm run check
|
|
155
|
+
- run: pnpm run build
|
|
156
|
+
- uses: actions/upload-pages-artifact@v3
|
|
157
|
+
with:
|
|
158
|
+
path: dist
|
|
159
|
+
|
|
160
|
+
deploy:
|
|
161
|
+
needs: build
|
|
162
|
+
runs-on: ubuntu-latest
|
|
163
|
+
environment:
|
|
164
|
+
name: github-pages
|
|
165
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
166
|
+
steps:
|
|
167
|
+
- id: deployment
|
|
168
|
+
uses: actions/deploy-pages@v4
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
In your repository settings, set Pages source to **GitHub Actions**.
|
|
172
|
+
|
|
173
|
+
## Monorepos
|
|
174
|
+
|
|
175
|
+
In a monorepo, run commands from the site package directory:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
cd packages/docs
|
|
179
|
+
pnpm run check
|
|
180
|
+
pnpm run build
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Or pass the site path to the CLI:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
pnpm exec preactpress build ./packages/docs
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Cache headers
|
|
190
|
+
|
|
191
|
+
Files under `assets/` include content hashes in their filenames. If your host lets you set HTTP headers, cache those files aggressively:
|
|
192
|
+
|
|
193
|
+
```text
|
|
194
|
+
Cache-Control: public, max-age=31536000, immutable
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Do not apply immutable caching to HTML files or JSON payloads such as `preactpress-search.json` and `preactpress-content/*.json`, because those URLs can keep the same names when content changes.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Your first 5 minutes
|
|
3
|
+
description: Change the site title, add a page, and update navigation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Your first 5 minutes
|
|
7
|
+
|
|
8
|
+
This hands-on tutorial follows the setup overview in [Getting Started](/guide/getting-started). Follow the steps below in **your** project — this site is the result.
|
|
9
|
+
|
|
10
|
+
## 1. Change the site title
|
|
11
|
+
|
|
12
|
+
Edit `.preactpress/config.ts`:
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
export default {
|
|
16
|
+
site: {
|
|
17
|
+
title: 'My Docs',
|
|
18
|
+
description: 'Short summary for search and social previews'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Save the file. The dev server picks up config changes on the next request.
|
|
24
|
+
|
|
25
|
+
## 2. Add a page
|
|
26
|
+
|
|
27
|
+
Create `about.md`:
|
|
28
|
+
|
|
29
|
+
```md
|
|
30
|
+
---
|
|
31
|
+
title: About
|
|
32
|
+
description: About this site
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
# About us
|
|
36
|
+
|
|
37
|
+
Your content here.
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
PreactPress serves it at `/about`. Every `.md` or `.mdx` file under `srcDir` (default: project root) becomes a URL automatically.
|
|
41
|
+
|
|
42
|
+
Example: `news/2025/intro.md` → `/news/2025/intro`.
|
|
43
|
+
|
|
44
|
+
This starter already includes [About](/about) so you can see the finished page.
|
|
45
|
+
|
|
46
|
+
## 3. Add it to the navigation
|
|
47
|
+
|
|
48
|
+
In `.preactpress/config.ts`:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
export default {
|
|
52
|
+
site: { title: 'My Docs' },
|
|
53
|
+
themeConfig: {
|
|
54
|
+
nav: [
|
|
55
|
+
{ text: 'Home', link: '/' },
|
|
56
|
+
{ text: 'About', link: '/about' }
|
|
57
|
+
],
|
|
58
|
+
sidebar: [
|
|
59
|
+
{
|
|
60
|
+
text: 'Guide',
|
|
61
|
+
items: [
|
|
62
|
+
{ text: 'Home', link: '/' },
|
|
63
|
+
{ text: 'About', link: '/about' }
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Save — the dev server hot-reloads your changes.
|
|
72
|
+
|
|
73
|
+
## Next steps
|
|
74
|
+
|
|
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
|
+
|
|
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.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Getting Started
|
|
3
|
+
description: Install PreactPress and start a new documentation site
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Getting Started
|
|
7
|
+
|
|
8
|
+
This guide shows how to create a PreactPress site, understand the generated files, and start the development server.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
You need:
|
|
13
|
+
|
|
14
|
+
| Requirement | Version |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| Node.js | 20 or higher |
|
|
17
|
+
| Package manager | pnpm recommended; npm, yarn, and bun also work |
|
|
18
|
+
| Editor | Any editor with Markdown and TypeScript support |
|
|
19
|
+
|
|
20
|
+
## Create a site
|
|
21
|
+
|
|
22
|
+
Start in an empty directory:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
mkdir my-site
|
|
26
|
+
cd my-site
|
|
27
|
+
pnpm dlx @kamod-ch/preactpress init
|
|
28
|
+
pnpm install
|
|
29
|
+
pnpm run dev
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
With npm:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
mkdir my-site
|
|
36
|
+
cd my-site
|
|
37
|
+
npx @kamod-ch/preactpress init
|
|
38
|
+
npm install
|
|
39
|
+
npm run dev
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Open **http://localhost:5173** to see the starter site.
|
|
43
|
+
|
|
44
|
+
> **Note**
|
|
45
|
+
> `preactpress init` copies the built-in starter template and writes `@kamod-ch/preactpress` to `devDependencies`. You do not need to install PreactPress separately before running the initializer.
|
|
46
|
+
|
|
47
|
+
## File structure
|
|
48
|
+
|
|
49
|
+
After initialization, the project looks like this:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
my-site/
|
|
53
|
+
├── README.md
|
|
54
|
+
├── index.html
|
|
55
|
+
├── index.md
|
|
56
|
+
├── about.md
|
|
57
|
+
├── guide/
|
|
58
|
+
│ └── first-five-minutes.md
|
|
59
|
+
├── markdown-examples.md
|
|
60
|
+
├── interactive.mdx
|
|
61
|
+
├── components/
|
|
62
|
+
│ └── Counter.tsx
|
|
63
|
+
└── .preactpress/
|
|
64
|
+
└── config.ts
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The `.preactpress` directory contains site configuration. Markdown and MDX files outside `.preactpress` are source files and become routes.
|
|
68
|
+
|
|
69
|
+
## The config file
|
|
70
|
+
|
|
71
|
+
The starter config lives at `.preactpress/config.ts`:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
export default {
|
|
75
|
+
site: {
|
|
76
|
+
title: 'My Docs',
|
|
77
|
+
description: 'Short summary for search and social previews'
|
|
78
|
+
},
|
|
79
|
+
themeConfig: {
|
|
80
|
+
nav: [
|
|
81
|
+
{ text: 'Home', link: '/' },
|
|
82
|
+
{ text: 'Guide', link: '/guide/what-is-preactpress' }
|
|
83
|
+
],
|
|
84
|
+
sidebar: [
|
|
85
|
+
{
|
|
86
|
+
text: 'Introduction',
|
|
87
|
+
items: [
|
|
88
|
+
{ text: 'What is PreactPress?', link: '/guide/what-is-preactpress' },
|
|
89
|
+
{ text: 'Getting Started', link: '/guide/getting-started' }
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Use `site` for site-wide metadata and `themeConfig` for default-theme options such as logo (`logo: '/logo.svg'`), nav, sidebar, search, outline, footer, and edit links.
|
|
98
|
+
|
|
99
|
+
## Source files
|
|
100
|
+
|
|
101
|
+
PreactPress uses file-based routing. By default, the source directory is the project root:
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
index.md -> /
|
|
105
|
+
about.md -> /about
|
|
106
|
+
guide/getting-started.md -> /guide/getting-started
|
|
107
|
+
interactive.mdx -> /interactive
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
You can change the source directory with `srcDir`:
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
export default {
|
|
114
|
+
srcDir: 'docs'
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
With this config, PreactPress reads pages from `docs/` while `.preactpress/config.ts` still belongs to the project root.
|
|
119
|
+
|
|
120
|
+
## Commands
|
|
121
|
+
|
|
122
|
+
The starter includes npm scripts:
|
|
123
|
+
|
|
124
|
+
| Command | Purpose |
|
|
125
|
+
| --- | --- |
|
|
126
|
+
| `pnpm run dev` | Start the dev server with SSR and hot reload |
|
|
127
|
+
| `pnpm run check` | Validate config, routes, and links |
|
|
128
|
+
| `pnpm run build` | Build the static production site into `dist/` |
|
|
129
|
+
| `pnpm run preview` | Preview the production build locally |
|
|
130
|
+
|
|
131
|
+
You can also call the CLI directly:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
pnpm exec preactpress dev
|
|
135
|
+
pnpm exec preactpress check
|
|
136
|
+
pnpm exec preactpress build
|
|
137
|
+
pnpm exec preactpress preview
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## What's next?
|
|
141
|
+
|
|
142
|
+
| Page | Why |
|
|
143
|
+
| --- | --- |
|
|
144
|
+
| [Your first 5 minutes](/guide/first-five-minutes) | Change the title, add a page, and wire navigation |
|
|
145
|
+
| [Routing](/guide/routing) | Learn how Markdown files map to URLs |
|
|
146
|
+
| [Deploy](/guide/deploy) | Build and publish the generated `dist/` directory |
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Routing
|
|
3
|
+
description: Understand how PreactPress maps files to URLs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Routing
|
|
7
|
+
|
|
8
|
+
PreactPress uses file-based routing. Every `.md` and `.mdx` file under `srcDir` becomes a route, and production builds write each route as static HTML.
|
|
9
|
+
|
|
10
|
+
## File-based routing
|
|
11
|
+
|
|
12
|
+
Given this structure:
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
.
|
|
16
|
+
├── index.md
|
|
17
|
+
├── about.md
|
|
18
|
+
├── guide/
|
|
19
|
+
│ ├── index.md
|
|
20
|
+
│ └── getting-started.md
|
|
21
|
+
└── interactive.mdx
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
PreactPress creates these routes:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
index.md -> /
|
|
28
|
+
about.md -> /about
|
|
29
|
+
guide/index.md -> /guide
|
|
30
|
+
guide/getting-started.md -> /guide/getting-started
|
|
31
|
+
interactive.mdx -> /interactive
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
During production builds, routes are written as directory indexes:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
/ -> dist/index.html
|
|
38
|
+
/about -> dist/about/index.html
|
|
39
|
+
/guide/getting-started -> dist/guide/getting-started/index.html
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
By default (`cleanUrls: true`), builds emit directory indexes so hosts can serve extensionless URLs.
|
|
43
|
+
|
|
44
|
+
## Project root and source directory
|
|
45
|
+
|
|
46
|
+
The project root is where PreactPress looks for `.preactpress/config.ts`.
|
|
47
|
+
|
|
48
|
+
By default, source files also live in the project root:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
.
|
|
52
|
+
├── .preactpress/
|
|
53
|
+
│ └── config.ts
|
|
54
|
+
├── index.md
|
|
55
|
+
└── guide/
|
|
56
|
+
└── getting-started.md
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
You can move content into a nested source directory with `srcDir`:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
export default {
|
|
63
|
+
srcDir: 'docs'
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
That produces this shape:
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
.
|
|
71
|
+
├── .preactpress/
|
|
72
|
+
│ └── config.ts
|
|
73
|
+
└── docs/
|
|
74
|
+
├── index.md
|
|
75
|
+
└── guide/
|
|
76
|
+
└── getting-started.md
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The resulting routes stay the same:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
docs/index.md -> /
|
|
83
|
+
docs/guide/getting-started.md -> /guide/getting-started
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Linking between pages
|
|
87
|
+
|
|
88
|
+
Use absolute or relative links. The recommended style is to omit file extensions:
|
|
89
|
+
|
|
90
|
+
```md
|
|
91
|
+
[Getting Started](/guide/getting-started)
|
|
92
|
+
[Routing](./routing)
|
|
93
|
+
[Home](../)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Avoid linking directly to generated HTML or source Markdown:
|
|
97
|
+
|
|
98
|
+
```md
|
|
99
|
+
<!-- Avoid -->
|
|
100
|
+
[Getting Started](/guide/getting-started.md)
|
|
101
|
+
[Getting Started](/guide/getting-started.html)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`preactpress check` validates local Markdown links that use `.md`, `.mdx`, or `.html` extensions and reports missing pages.
|
|
105
|
+
|
|
106
|
+
## Locale routes
|
|
107
|
+
|
|
108
|
+
PreactPress supports VitePress-style locale folders. Keep the default language at the root and put translations in locale folders:
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
index.md -> /
|
|
112
|
+
guide/getting-started.md -> /guide/getting-started
|
|
113
|
+
de/index.md -> /de
|
|
114
|
+
de/guide/getting-started.md -> /de/guide/getting-started
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Configure locale labels, language codes, and locale-specific nav in `.preactpress/config.ts`:
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
export default {
|
|
121
|
+
locales: {
|
|
122
|
+
root: {
|
|
123
|
+
label: 'English',
|
|
124
|
+
lang: 'en'
|
|
125
|
+
},
|
|
126
|
+
de: {
|
|
127
|
+
label: 'Deutsch',
|
|
128
|
+
lang: 'de',
|
|
129
|
+
link: '/de/'
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The default theme shows a language switcher when multiple locales are configured.
|
|
136
|
+
|
|
137
|
+
## Tag routes
|
|
138
|
+
|
|
139
|
+
Pages can define tags in frontmatter:
|
|
140
|
+
|
|
141
|
+
```md
|
|
142
|
+
---
|
|
143
|
+
title: Release notes
|
|
144
|
+
tags: [release, changelog]
|
|
145
|
+
---
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Each tag receives an index page:
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
release -> /tags/release
|
|
152
|
+
changelog -> /tags/changelog
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
For localized content, tag pages are scoped to the locale:
|
|
156
|
+
|
|
157
|
+
```text
|
|
158
|
+
de/guide/intro.md with tag "Markdown" -> /de/tags/markdown
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
If a real Markdown or MDX page exists at the same route as a generated tag index, the real page wins.
|
|
162
|
+
|
|
163
|
+
## Base path
|
|
164
|
+
|
|
165
|
+
Use `site.base` when the site is served from a subpath, for example GitHub Pages project sites:
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
export default {
|
|
169
|
+
site: {
|
|
170
|
+
base: '/my-repo/'
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
You can also override it for one build:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
pnpm exec preactpress build --base /my-repo/
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Route rewrites
|
|
182
|
+
|
|
183
|
+
Map a public URL to existing content without duplicating files:
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
export default {
|
|
187
|
+
rewrites: {
|
|
188
|
+
'/docs': '/guide',
|
|
189
|
+
'/getting-started': '/guide/intro'
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Keys are the routes visitors use; values must point at routes that already exist from your Markdown files. `preactpress check` validates rewrite sources and collisions.
|
|
195
|
+
|
|
196
|
+
## Clean URLs and hosting
|
|
197
|
+
|
|
198
|
+
| `cleanUrls` | Output for `/about` | Typical host |
|
|
199
|
+
| --- | --- | --- |
|
|
200
|
+
| `true` (default) | `dist/about/index.html` | Netlify, Vercel, Cloudflare Pages, GitHub Pages |
|
|
201
|
+
| `false` | `dist/about.html` | Static buckets without directory index support |
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
export default {
|
|
205
|
+
cleanUrls: false
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Most modern static hosts work with the default. Set `cleanUrls: false` only when your host cannot resolve `/about` to `about/index.html`.
|
|
210
|
+
|
|
211
|
+
## Dynamic routes
|
|
212
|
+
|
|
213
|
+
Generate routes at build time with a bracket template and a colocated `.paths.ts` file:
|
|
214
|
+
|
|
215
|
+
```md
|
|
216
|
+
<!-- packages/[pkg].md -->
|
|
217
|
+
---
|
|
218
|
+
title: "{{ params.pkg }}"
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
# {{ params.pkg }}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
// packages/[pkg].paths.ts
|
|
226
|
+
export default {
|
|
227
|
+
paths() {
|
|
228
|
+
return [
|
|
229
|
+
{ params: { pkg: 'preact' } },
|
|
230
|
+
{ params: { pkg: 'vite' }, props: { note: 'Build tool' } }
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
This emits `/packages/preact` and `/packages/vite`. Use `{{ params.key }}` and `{{ props.key }}` in frontmatter and body.
|
|
237
|
+
|
|
238
|
+
## Data loaders
|
|
239
|
+
|
|
240
|
+
Colocate `*.data.ts` with a page to load build-time data via `createContentLoader` from `@kamod-ch/preactpress/config`. The result is exposed on `page.meta.contentData` (and in themes through the `page` prop).
|
|
241
|
+
|
|
242
|
+
```ts
|
|
243
|
+
// blog.data.ts
|
|
244
|
+
import { createContentLoader } from '@kamod-ch/preactpress/config'
|
|
245
|
+
|
|
246
|
+
export default createContentLoader('posts/*.md', {
|
|
247
|
+
transform(items) {
|
|
248
|
+
return items.map((item) => ({
|
|
249
|
+
title: item.title,
|
|
250
|
+
route: item.route
|
|
251
|
+
}))
|
|
252
|
+
}
|
|
253
|
+
})
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Pair with `blog.md` or `blog/index.md` for route `/blog`.
|
|
257
|
+
|
|
258
|
+
## Current limitations
|
|
259
|
+
|
|
260
|
+
| Feature | Status |
|
|
261
|
+
| --- | --- |
|
|
262
|
+
| Dynamic MDX templates (`[id].mdx`) | Not supported (use `.md` templates) |
|
|
263
|
+
| Pattern-based rewrites with params | Not supported |
|