@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,234 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Creating pages | Hono Starter</title>
|
|
7
|
+
<script src="/preactpress-theme.js"></script>
|
|
8
|
+
<meta name="description" content="Add new Markdown and MDX pages, understand URLs, and wire them into navigation">
|
|
9
|
+
<meta property="og:title" content="Creating pages | Hono Starter">
|
|
10
|
+
<meta property="og:description" content="Add new Markdown and MDX pages, understand URLs, and wire them into navigation">
|
|
11
|
+
<meta property="og:type" content="website">
|
|
12
|
+
<meta property="og:url" content="/guide/creating-pages/">
|
|
13
|
+
<meta name="twitter:card" content="summary">
|
|
14
|
+
<meta name="twitter:title" content="Creating pages | Hono Starter">
|
|
15
|
+
<meta name="twitter:description" content="Add new Markdown and MDX pages, understand URLs, and wire them into navigation">
|
|
16
|
+
<link rel="canonical" href="/guide/creating-pages/">
|
|
17
|
+
<script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","headline":"Creating pages | Hono Starter","name":"Creating pages | Hono Starter","description":"Add new Markdown and MDX pages, understand URLs, and wire them into navigation","url":"/guide/creating-pages/","dateModified":"2026-06-05T05:42:40.492Z"}</script>
|
|
18
|
+
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
|
19
|
+
<link rel="icon" href="/favicon-32.png" type="image/png" sizes="32x32">
|
|
20
|
+
<link rel="icon" href="/favicon.png" type="image/png" sizes="any">
|
|
21
|
+
<link rel="apple-touch-icon" href="/favicon.png">
|
|
22
|
+
<link rel="stylesheet" crossorigin href="/assets/main-DIIN7FO0.css">
|
|
23
|
+
</head>
|
|
24
|
+
<body>
|
|
25
|
+
<template id="__PREACTPRESS_PAGE_DATA__">{"kind":"markdown","meta":{"title":"Creating pages","description":"Add new Markdown and MDX pages, understand URLs, and wire them into navigation"},"html":"\u003ch1 id=\"creating-pages\" class=\"pp-heading\">Creating pages\u003ca class=\"pp-heading-anchor\" href=\"#creating-pages\" aria-label=\"Link to this section\">#\u003c/a>\u003c/h1>\n\u003cp>PreactPress builds pages from files — there is no separate page editor or CMS. Every \u003ccode>.md\u003c/code> or \u003ccode>.mdx\u003c/code> file under the source directory (\u003ccode>srcDir\u003c/code>, default: project root) automatically becomes a public URL.\u003c/p>\n\u003ch2 id=\"quick-overview\" class=\"pp-heading\">Quick overview\u003ca class=\"pp-heading-anchor\" href=\"#quick-overview\" aria-label=\"Link to this section\">#\u003c/a>\u003c/h2>\n\u003col>\n\u003cli>Create a new file (e.g. \u003ccode>contact.md\u003c/code> or \u003ccode>guide/new-page.md\u003c/code>).\u003c/li>\n\u003cli>Optionally add frontmatter with \u003ccode>title\u003c/code>, \u003ccode>description\u003c/code>, and \u003ccode>layout\u003c/code>.\u003c/li>\n\u003cli>Write content in Markdown or MDX.\u003c/li>\n\u003cli>The dev server picks up changes automatically — no restart required.\u003c/li>\n\u003cli>Optionally add entries to \u003ccode>nav\u003c/code> and \u003ccode>sidebar\u003c/code> in \u003ccode>.preactpress/config.ts\u003c/code>.\u003c/li>\n\u003c/ol>\n\u003ch2 id=\"step-by-step-a-simple-page\" class=\"pp-heading\">Step by step: a simple page\u003ca class=\"pp-heading-anchor\" href=\"#step-by-step-a-simple-page\" aria-label=\"Link to this section\">#\u003c/a>\u003c/h2>\n\u003cp>Create a Markdown file in the project root (or under \u003ccode>srcDir\u003c/code>), for example \u003ccode>contact.md\u003c/code>:\u003c/p>\n\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" tabindex=\"0\">\u003ccode>\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">---\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#22863A;--shiki-dark:#85E89D\">title\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">Contact\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#22863A;--shiki-dark:#85E89D\">description\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">How to reach us\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#22863A;--shiki-dark:#85E89D\">layout\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">page\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">---\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold\"># Contact\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">Email us at \u003c/span>\u003cspan style=\"color:#24292E;--shiki-light-font-weight:bold;--shiki-dark:#E1E4E8;--shiki-dark-font-weight:bold\">**hello@example.com**\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">.\u003c/span>\u003c/span>\u003c/code>\u003c/pre>\u003cp>Save the file — with \u003ccode>pnpm run dev\u003c/code> running, the page is immediately available at \u003cstrong>/contact\u003c/strong>.\u003c/p>\n\u003cblockquote>\n\u003cp>\u003cstrong>Note\u003c/strong>\nThe file name (without extension) determines the URL path. \u003ccode>contact.md\u003c/code> → \u003ccode>/contact\u003c/code>, not \u003ccode>/contact.md\u003c/code>.\u003c/p>\n\u003c/blockquote>\n\u003ch2 id=\"file-location-url\" class=\"pp-heading\">File location → URL\u003ca class=\"pp-heading-anchor\" href=\"#file-location-url\" aria-label=\"Link to this section\">#\u003c/a>\u003c/h2>\n\u003cp>PreactPress uses \u003cstrong>file-based routing\u003c/strong>. The path relative to \u003ccode>srcDir\u003c/code> becomes the route:\u003c/p>\n\u003ctable>\n\u003cthead>\n\u003ctr>\n\u003cth>File\u003c/th>\n\u003cth>URL\u003c/th>\n\u003c/tr>\n\u003c/thead>\n\u003ctbody>\n\u003ctr>\n\u003ctd>\u003ccode>index.md\u003c/code>\u003c/td>\n\u003ctd>\u003ccode>/\u003c/code>\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>\u003ccode>about.md\u003c/code>\u003c/td>\n\u003ctd>\u003ccode>/about\u003c/code>\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>\u003ccode>guide/intro.md\u003c/code>\u003c/td>\n\u003ctd>\u003ccode>/guide/intro\u003c/code>\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>\u003ccode>guide/index.md\u003c/code>\u003c/td>\n\u003ctd>\u003ccode>/guide\u003c/code>\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>\u003ccode>news/2025/intro.md\u003c/code>\u003c/td>\n\u003ctd>\u003ccode>/news/2025/intro\u003c/code>\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>\u003ccode>interactive.mdx\u003c/code>\u003c/td>\n\u003ctd>\u003ccode>/interactive\u003c/code>\u003c/td>\n\u003c/tr>\n\u003c/tbody>\n\u003c/table>\n\u003cp>Production builds write directory indexes (\u003ccode>dist/about/index.html\u003c/code>) so URLs work without \u003ccode>.html\u003c/code>.\u003c/p>\n\u003cp>More detail: \u003ca href=\"/guide/routing\">Routing\u003c/a>.\u003c/p>\n\u003ch2 id=\"source-directory-srcdir\" class=\"pp-heading\">Source directory (\u003ccode>srcDir\u003c/code>)\u003ca class=\"pp-heading-anchor\" href=\"#source-directory-srcdir\" aria-label=\"Link to this section\">#\u003c/a>\u003c/h2>\n\u003cp>By default, Markdown files live in the project root next to \u003ccode>.preactpress/\u003c/code>. You can move content into a subfolder:\u003c/p>\n\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" tabindex=\"0\">\u003ccode>\u003cspan class=\"line\">\u003cspan style=\"color:#6A737D;--shiki-dark:#6A737D\">// .preactpress/config.ts\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">export\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> default\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> srcDir: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'docs'\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">}\u003c/span>\u003c/span>\u003c/code>\u003c/pre>\u003cp>Then all pages live under \u003ccode>docs/\u003c/code> — e.g. \u003ccode>docs/index.md\u003c/code> → \u003ccode>/\u003c/code>, \u003ccode>docs/guide/foo.md\u003c/code> → \u003ccode>/guide/foo\u003c/code>. URLs stay the same; only the file location changes.\u003c/p>\n\u003ch2 id=\"frontmatter-optional-but-recommended\" class=\"pp-heading\">Frontmatter (optional but recommended)\u003ca class=\"pp-heading-anchor\" href=\"#frontmatter-optional-but-recommended\" aria-label=\"Link to this section\">#\u003c/a>\u003c/h2>\n\u003cp>YAML at the top of the file controls metadata and layout:\u003c/p>\n\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" tabindex=\"0\">\u003ccode>\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">---\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#22863A;--shiki-dark:#85E89D\">title\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">My page\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#22863A;--shiki-dark:#85E89D\">description\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">Short summary for search, SEO, and social previews\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#22863A;--shiki-dark:#85E89D\">layout\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">doc\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">---\u003c/span>\u003c/span>\u003c/code>\u003c/pre>\u003ctable>\n\u003cthead>\n\u003ctr>\n\u003cth>Field\u003c/th>\n\u003cth>Purpose\u003c/th>\n\u003c/tr>\n\u003c/thead>\n\u003ctbody>\n\u003ctr>\n\u003ctd>\u003ccode>title\u003c/code>\u003c/td>\n\u003ctd>Page title (nav, \u003ccode>&lt;title&gt;\u003c/code>, search)\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>\u003ccode>description\u003c/code>\u003c/td>\n\u003ctd>Summary for SEO and search\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>\u003ccode>layout: doc\u003c/code>\u003c/td>\n\u003ctd>Docs layout with sidebar, outline, and previous/next links\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>\u003ccode>layout: page\u003c/code>\u003c/td>\n\u003ctd>Content page without sidebar or doc outline\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>\u003ccode>layout: home\u003c/code>\u003c/td>\n\u003ctd>Home layout with optional \u003ccode>hero\u003c/code> and \u003ccode>features\u003c/code>\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>\u003ccode>draft: true\u003c/code>\u003c/td>\n\u003ctd>Excluded from build, sitemap, and search\u003c/td>\n\u003c/tr>\n\u003c/tbody>\n\u003c/table>\n\u003cp>Additional fields (\u003ccode>tags\u003c/code>, \u003ccode>sidebar: false\u003c/code>, \u003ccode>navbar: false\u003c/code>, …) are documented in the package README and starter reference.\u003c/p>\n\u003ch2 id=\"mdx-pages-with-components\" class=\"pp-heading\">MDX pages with components\u003ca class=\"pp-heading-anchor\" href=\"#mdx-pages-with-components\" aria-label=\"Link to this section\">#\u003c/a>\u003c/h2>\n\u003cp>When you need interactive UI, use \u003ccode>.mdx\u003c/code> instead of \u003ccode>.md\u003c/code>:\u003c/p>\n\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" tabindex=\"0\">\u003ccode>\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">---\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#22863A;--shiki-dark:#85E89D\">title\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">Demo\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#22863A;--shiki-dark:#85E89D\">description\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">Interactive component\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">---\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">import Counter from './components/Counter.tsx'\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold\">## Counter\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">&#x3C;Counter initial={3} />\u003c/span>\u003c/span>\u003c/code>\u003c/pre>\u003cp>Import components relative to the MDX file. \u003ccode>##\u003c/code> and \u003ccode>###\u003c/code> headings feed the on-page outline (with \u003ccode>layout: doc\u003c/code>).\u003c/p>\n\u003cp>Example in this starter: \u003ca href=\"/interactive\">Interactive MDX\u003c/a>.\u003c/p>\n\u003ch2 id=\"add-to-navigation\" class=\"pp-heading\">Add to navigation\u003ca class=\"pp-heading-anchor\" href=\"#add-to-navigation\" aria-label=\"Link to this section\">#\u003c/a>\u003c/h2>\n\u003cp>New pages do \u003cstrong>not\u003c/strong> appear in the header or sidebar automatically. Register them in \u003ccode>.preactpress/config.ts\u003c/code>:\u003c/p>\n\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" tabindex=\"0\">\u003ccode>\u003cspan class=\"line\">\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\">export\u003c/span>\u003cspan style=\"color:#D73A49;--shiki-dark:#F97583\"> default\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> themeConfig: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> nav: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> { text: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'Home'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, link: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'/'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> { text: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'Contact'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, link: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'/contact'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> sidebar: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> text: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'Guide'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> items: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> { text: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'Creating pages'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, link: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'/guide/creating-pages'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> { text: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'Contact'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">, link: \u003c/span>\u003cspan style=\"color:#032F62;--shiki-dark:#9ECBFF\">'/contact'\u003c/span>\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#24292E;--shiki-dark:#E1E4E8\">}\u003c/span>\u003c/span>\u003c/code>\u003c/pre>\u003cp>For multilingual sites (\u003ccode>locales\u003c/code>), put \u003ccode>nav\u003c/code> and \u003ccode>sidebar\u003c/code> in each locale block — see \u003ca href=\"/guide/getting-started\">Getting Started\u003c/a>.\u003c/p>\n\u003ch2 id=\"translated-page-locale\" class=\"pp-heading\">Translated page (locale)\u003ca class=\"pp-heading-anchor\" href=\"#translated-page-locale\" aria-label=\"Link to this section\">#\u003c/a>\u003c/h2>\n\u003cp>With locales configured, add translations in language folders:\u003c/p>\n\u003cpre class=\"shiki shiki-themes github-light github-dark\" style=\"background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8\" tabindex=\"0\">\u003ccode>\u003cspan class=\"line\">\u003cspan>contact.md -> /contact\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan>de/contact.md -> /de/contact\u003c/span>\u003c/span>\u003c/code>\u003c/pre>\u003cp>Each locale is a \u003cstrong>separate file\u003c/strong>, not an alias of the default page.\u003c/p>\n\u003ch2 id=\"drafts-and-validation\" class=\"pp-heading\">Drafts and validation\u003ca class=\"pp-heading-anchor\" href=\"#drafts-and-validation\" aria-label=\"Link to this section\">#\u003c/a>\u003c/h2>\n\u003cul>\n\u003cli>\u003cstrong>\u003ccode>draft: true\u003c/code>\u003c/strong> in frontmatter: visible in dev only, excluded from production builds.\u003c/li>\n\u003cli>\u003cstrong>\u003ccode>pnpm run check\u003c/code>\u003c/strong>: validates missing links, unknown layouts, route collisions, and warns on drafts without descriptions.\u003c/li>\n\u003c/ul>\n\u003ch2 id=\"common-issues\" class=\"pp-heading\">Common issues\u003ca class=\"pp-heading-anchor\" href=\"#common-issues\" aria-label=\"Link to this section\">#\u003c/a>\u003c/h2>\n\u003ctable>\n\u003cthead>\n\u003ctr>\n\u003cth>Problem\u003c/th>\n\u003cth>Fix\u003c/th>\n\u003c/tr>\n\u003c/thead>\n\u003ctbody>\n\u003ctr>\n\u003ctd>Page returns 404\u003c/td>\n\u003ctd>\u003ccode>.md\u003c/code> / \u003ccode>.mdx\u003c/code> extension? File under \u003ccode>srcDir\u003c/code>? Dev server running?\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>Markdown link broken\u003c/td>\n\u003ctd>Omit extension: \u003ccode>/guide/foo\u003c/code>, not \u003ccode>/guide/foo.md\u003c/code>\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>Duplicate URL\u003c/td>\n\u003ctd>Two files must not map to the same route (e.g. \u003ccode>foo.md\u003c/code> and \u003ccode>foo/index.md\u003c/code>)\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>Page missing from nav\u003c/td>\n\u003ctd>Add to \u003ccode>nav\u003c/code> / \u003ccode>sidebar\u003c/code> in config\u003c/td>\n\u003c/tr>\n\u003c/tbody>\n\u003c/table>\n\u003ch2 id=\"next-steps\" class=\"pp-heading\">Next steps\u003ca class=\"pp-heading-anchor\" href=\"#next-steps\" aria-label=\"Link to this section\">#\u003c/a>\u003c/h2>\n\u003ctable>\n\u003cthead>\n\u003ctr>\n\u003cth>Topic\u003c/th>\n\u003cth>Link\u003c/th>\n\u003c/tr>\n\u003c/thead>\n\u003ctbody>\n\u003ctr>\n\u003ctd>First changes in 5 minutes\u003c/td>\n\u003ctd>\u003ca href=\"/guide/first-five-minutes\">Your first 5 minutes\u003c/a>\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>Routing, \u003ccode>srcDir\u003c/code>, tags\u003c/td>\n\u003ctd>\u003ca href=\"/guide/routing\">Routing\u003c/a>\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>Markdown syntax\u003c/td>\n\u003ctd>\u003ca href=\"/markdown-examples\">Markdown examples\u003c/a>\u003c/td>\n\u003c/tr>\n\u003ctr>\n\u003ctd>Production build\u003c/td>\n\u003ctd>\u003ca href=\"/guide/deploy\">Deploy\u003c/a>\u003c/td>\n\u003c/tr>\n\u003c/tbody>\n\u003c/table>\n","title":"Creating pages","description":"Add new Markdown and MDX pages, understand URLs, and wire them into navigation","tags":[],"pageType":"website","headings":[{"id":"quick-overview","text":"Quick overview","level":2},{"id":"step-by-step-a-simple-page","text":"Step by step: a simple page","level":2},{"id":"file-location-url","text":"File location → URL","level":2},{"id":"source-directory-srcdir","text":"Source directory (srcDir)","level":2},{"id":"frontmatter-optional-but-recommended","text":"Frontmatter (optional but recommended)","level":2},{"id":"mdx-pages-with-components","text":"MDX pages with components","level":2},{"id":"add-to-navigation","text":"Add to navigation","level":2},{"id":"translated-page-locale","text":"Translated page (locale)","level":2},{"id":"drafts-and-validation","text":"Drafts and validation","level":2},{"id":"common-issues","text":"Common issues","level":2},{"id":"next-steps","text":"Next steps","level":2}],"relativePath":"guide/creating-pages.md","lastUpdated":"2026-06-05T05:42:40.492Z"}</template>
|
|
26
|
+
<div id="app"><div class="hn-site"><a class="hn-skip" href="#content">Skip to content</a><header class="hn-header"><div class="hn-header-inner"><a class="hn-brand" href="/" aria-label="Hono Starter"><span class="hn-logo" aria-label="Hono Starter"><svg aria-hidden="true" viewBox="0 0 36 36" width="36" height="36"><rect width="36" height="36" rx="11" fill="currentColor" opacity="0.12"></rect><path d="M19.8 5.5c.8 4-2.8 5.9-4.7 8.2-1.8 2.1-2.5 4.9-.3 7 0-2.8 1.7-4.6 4.2-6.7 3.2 3 5.3 5.8 5.3 9.2 0 4.4-3.3 7.3-7.6 7.3-4.8 0-8.3-3.6-8.3-8.4 0-6.1 6.3-9.2 11.4-16.6Z" fill="currentColor"></path><path d="M21.7 25.7c0 2.2-1.7 3.8-3.9 3.8s-4-1.6-4-3.8c0-1.7 1-3.1 3.4-5.2.1 1.7 1.4 2.6 2.4 3.4.8.6 2.1 1 2.1 1.8Z" fill="currentColor" opacity="0.38"></path></svg><span>Hono Starter</span></span></a><div class="hn-header-actions"><nav class="hn-nav" aria-label="Main navigation"><a class href="/guide/what-is-preactpress">Docs</a><a class href="/markdown-examples">Examples</a><a class href="/about">About</a></nav><div class="hn-social" aria-label="Social links"><a href="https://github.com/your-org/your-project" aria-label="GitHub"><span><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path fill="currentColor" d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.404 1.02.005 2.04.137 3 .404 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></span></a></div><details class="hn-locale-switcher"><summary>English</summary><div class="hn-locale-menu"><a href="/guide/creating-pages" aria-current="page" class="active">English</a><a href="/de" class>Deutsch</a></div></details><button type="button" class="hn-theme-toggle" aria-label="Toggle theme"><span class="hn-theme-toggle-moon" aria-hidden="true"><svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor"><path d="M21 14.8A8.5 8.5 0 0 1 9.2 3a7 7 0 1 0 11.8 11.8Z" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7"></path></svg></span><span class="hn-theme-toggle-sun" aria-hidden="true"><svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor"><circle cx="12" cy="12" r="3.5" stroke-width="1.7"></circle><path d="M12 2.5v2M12 19.5v2M4.6 4.6 6 6M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4" stroke-linecap="round" stroke-width="1.7"></path></svg></span></button></div></div></header><div class="hn-doc-shell"><aside class="hn-sidebar" aria-label="Documentation navigation"><div class="hn-sidebar-panel"><label class="hn-search"><span>Search pages</span><input type="search" value placeholder="Filter documentation..."/></label><div class="hn-sidebar-group"><h2>Introduction</h2><ul><li><a class href="/">Welcome</a></li><li><a class href="/guide/what-is-preactpress">What is PreactPress?</a></li><li><a class href="/guide/getting-started">Getting Started</a></li><li><a class href="/guide/routing">Routing</a></li><li><a class href="/guide/deploy">Deploy</a></li><li><a class href="/guide/first-five-minutes">Your first 5 minutes</a></li><li><a class="active" href="/guide/creating-pages" aria-current="page">Creating pages</a></li><li><a class href="/guide/commands">Commands</a></li><li><a class href="/guide/configuration">Configuration</a></li></ul></div><div class="hn-sidebar-group"><h2>Reference</h2><ul><li><a class href="/markdown-examples">Markdown examples</a></li><li><a class href="/interactive">Interactive MDX</a></li></ul></div></div></aside><main id="content" class="hn-doc-main"><article class="hn-doc"><h1 class="hn-doc-title">Creating pages</h1><p class="hn-doc-lead">Add new Markdown and MDX pages, understand URLs, and wire them into navigation</p><div class="hn-doc-content"><h1 id="creating-pages" class="pp-heading">Creating pages<a class="pp-heading-anchor" href="#creating-pages" aria-label="Link to this section">#</a></h1>
|
|
27
|
+
<p>PreactPress builds pages from files — there is no separate page editor or CMS. Every <code>.md</code> or <code>.mdx</code> file under the source directory (<code>srcDir</code>, default: project root) automatically becomes a public URL.</p>
|
|
28
|
+
<h2 id="quick-overview" class="pp-heading">Quick overview<a class="pp-heading-anchor" href="#quick-overview" aria-label="Link to this section">#</a></h2>
|
|
29
|
+
<ol>
|
|
30
|
+
<li>Create a new file (e.g. <code>contact.md</code> or <code>guide/new-page.md</code>).</li>
|
|
31
|
+
<li>Optionally add frontmatter with <code>title</code>, <code>description</code>, and <code>layout</code>.</li>
|
|
32
|
+
<li>Write content in Markdown or MDX.</li>
|
|
33
|
+
<li>The dev server picks up changes automatically — no restart required.</li>
|
|
34
|
+
<li>Optionally add entries to <code>nav</code> and <code>sidebar</code> in <code>.preactpress/config.ts</code>.</li>
|
|
35
|
+
</ol>
|
|
36
|
+
<h2 id="step-by-step-a-simple-page" class="pp-heading">Step by step: a simple page<a class="pp-heading-anchor" href="#step-by-step-a-simple-page" aria-label="Link to this section">#</a></h2>
|
|
37
|
+
<p>Create a Markdown file in the project root (or under <code>srcDir</code>), for example <code>contact.md</code>:</p>
|
|
38
|
+
<pre class="shiki shiki-themes github-light github-dark" style="background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8" tabindex="0"><code><span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">---</span></span>
|
|
39
|
+
<span class="line"><span style="color:#22863A;--shiki-dark:#85E89D">title</span><span style="color:#24292E;--shiki-dark:#E1E4E8">: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">Contact</span></span>
|
|
40
|
+
<span class="line"><span style="color:#22863A;--shiki-dark:#85E89D">description</span><span style="color:#24292E;--shiki-dark:#E1E4E8">: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">How to reach us</span></span>
|
|
41
|
+
<span class="line"><span style="color:#22863A;--shiki-dark:#85E89D">layout</span><span style="color:#24292E;--shiki-dark:#E1E4E8">: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">page</span></span>
|
|
42
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">---</span></span>
|
|
43
|
+
<span class="line"></span>
|
|
44
|
+
<span class="line"><span style="color:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold"># Contact</span></span>
|
|
45
|
+
<span class="line"></span>
|
|
46
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">Email us at </span><span style="color:#24292E;--shiki-light-font-weight:bold;--shiki-dark:#E1E4E8;--shiki-dark-font-weight:bold">**hello@example.com**</span><span style="color:#24292E;--shiki-dark:#E1E4E8">.</span></span></code></pre><p>Save the file — with <code>pnpm run dev</code> running, the page is immediately available at <strong>/contact</strong>.</p>
|
|
47
|
+
<blockquote>
|
|
48
|
+
<p><strong>Note</strong>
|
|
49
|
+
The file name (without extension) determines the URL path. <code>contact.md</code> → <code>/contact</code>, not <code>/contact.md</code>.</p>
|
|
50
|
+
</blockquote>
|
|
51
|
+
<h2 id="file-location-url" class="pp-heading">File location → URL<a class="pp-heading-anchor" href="#file-location-url" aria-label="Link to this section">#</a></h2>
|
|
52
|
+
<p>PreactPress uses <strong>file-based routing</strong>. The path relative to <code>srcDir</code> becomes the route:</p>
|
|
53
|
+
<table>
|
|
54
|
+
<thead>
|
|
55
|
+
<tr>
|
|
56
|
+
<th>File</th>
|
|
57
|
+
<th>URL</th>
|
|
58
|
+
</tr>
|
|
59
|
+
</thead>
|
|
60
|
+
<tbody>
|
|
61
|
+
<tr>
|
|
62
|
+
<td><code>index.md</code></td>
|
|
63
|
+
<td><code>/</code></td>
|
|
64
|
+
</tr>
|
|
65
|
+
<tr>
|
|
66
|
+
<td><code>about.md</code></td>
|
|
67
|
+
<td><code>/about</code></td>
|
|
68
|
+
</tr>
|
|
69
|
+
<tr>
|
|
70
|
+
<td><code>guide/intro.md</code></td>
|
|
71
|
+
<td><code>/guide/intro</code></td>
|
|
72
|
+
</tr>
|
|
73
|
+
<tr>
|
|
74
|
+
<td><code>guide/index.md</code></td>
|
|
75
|
+
<td><code>/guide</code></td>
|
|
76
|
+
</tr>
|
|
77
|
+
<tr>
|
|
78
|
+
<td><code>news/2025/intro.md</code></td>
|
|
79
|
+
<td><code>/news/2025/intro</code></td>
|
|
80
|
+
</tr>
|
|
81
|
+
<tr>
|
|
82
|
+
<td><code>interactive.mdx</code></td>
|
|
83
|
+
<td><code>/interactive</code></td>
|
|
84
|
+
</tr>
|
|
85
|
+
</tbody>
|
|
86
|
+
</table>
|
|
87
|
+
<p>Production builds write directory indexes (<code>dist/about/index.html</code>) so URLs work without <code>.html</code>.</p>
|
|
88
|
+
<p>More detail: <a href="/guide/routing">Routing</a>.</p>
|
|
89
|
+
<h2 id="source-directory-srcdir" class="pp-heading">Source directory (<code>srcDir</code>)<a class="pp-heading-anchor" href="#source-directory-srcdir" aria-label="Link to this section">#</a></h2>
|
|
90
|
+
<p>By default, Markdown files live in the project root next to <code>.preactpress/</code>. You can move content into a subfolder:</p>
|
|
91
|
+
<pre class="shiki shiki-themes github-light github-dark" style="background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8" tabindex="0"><code><span class="line"><span style="color:#6A737D;--shiki-dark:#6A737D">// .preactpress/config.ts</span></span>
|
|
92
|
+
<span class="line"><span style="color:#D73A49;--shiki-dark:#F97583">export</span><span style="color:#D73A49;--shiki-dark:#F97583"> default</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
|
|
93
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> srcDir: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">'docs'</span></span>
|
|
94
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre><p>Then all pages live under <code>docs/</code> — e.g. <code>docs/index.md</code> → <code>/</code>, <code>docs/guide/foo.md</code> → <code>/guide/foo</code>. URLs stay the same; only the file location changes.</p>
|
|
95
|
+
<h2 id="frontmatter-optional-but-recommended" class="pp-heading">Frontmatter (optional but recommended)<a class="pp-heading-anchor" href="#frontmatter-optional-but-recommended" aria-label="Link to this section">#</a></h2>
|
|
96
|
+
<p>YAML at the top of the file controls metadata and layout:</p>
|
|
97
|
+
<pre class="shiki shiki-themes github-light github-dark" style="background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8" tabindex="0"><code><span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">---</span></span>
|
|
98
|
+
<span class="line"><span style="color:#22863A;--shiki-dark:#85E89D">title</span><span style="color:#24292E;--shiki-dark:#E1E4E8">: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">My page</span></span>
|
|
99
|
+
<span class="line"><span style="color:#22863A;--shiki-dark:#85E89D">description</span><span style="color:#24292E;--shiki-dark:#E1E4E8">: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">Short summary for search, SEO, and social previews</span></span>
|
|
100
|
+
<span class="line"><span style="color:#22863A;--shiki-dark:#85E89D">layout</span><span style="color:#24292E;--shiki-dark:#E1E4E8">: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">doc</span></span>
|
|
101
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">---</span></span></code></pre><table>
|
|
102
|
+
<thead>
|
|
103
|
+
<tr>
|
|
104
|
+
<th>Field</th>
|
|
105
|
+
<th>Purpose</th>
|
|
106
|
+
</tr>
|
|
107
|
+
</thead>
|
|
108
|
+
<tbody>
|
|
109
|
+
<tr>
|
|
110
|
+
<td><code>title</code></td>
|
|
111
|
+
<td>Page title (nav, <code><title></code>, search)</td>
|
|
112
|
+
</tr>
|
|
113
|
+
<tr>
|
|
114
|
+
<td><code>description</code></td>
|
|
115
|
+
<td>Summary for SEO and search</td>
|
|
116
|
+
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<td><code>layout: doc</code></td>
|
|
119
|
+
<td>Docs layout with sidebar, outline, and previous/next links</td>
|
|
120
|
+
</tr>
|
|
121
|
+
<tr>
|
|
122
|
+
<td><code>layout: page</code></td>
|
|
123
|
+
<td>Content page without sidebar or doc outline</td>
|
|
124
|
+
</tr>
|
|
125
|
+
<tr>
|
|
126
|
+
<td><code>layout: home</code></td>
|
|
127
|
+
<td>Home layout with optional <code>hero</code> and <code>features</code></td>
|
|
128
|
+
</tr>
|
|
129
|
+
<tr>
|
|
130
|
+
<td><code>draft: true</code></td>
|
|
131
|
+
<td>Excluded from build, sitemap, and search</td>
|
|
132
|
+
</tr>
|
|
133
|
+
</tbody>
|
|
134
|
+
</table>
|
|
135
|
+
<p>Additional fields (<code>tags</code>, <code>sidebar: false</code>, <code>navbar: false</code>, …) are documented in the package README and starter reference.</p>
|
|
136
|
+
<h2 id="mdx-pages-with-components" class="pp-heading">MDX pages with components<a class="pp-heading-anchor" href="#mdx-pages-with-components" aria-label="Link to this section">#</a></h2>
|
|
137
|
+
<p>When you need interactive UI, use <code>.mdx</code> instead of <code>.md</code>:</p>
|
|
138
|
+
<pre class="shiki shiki-themes github-light github-dark" style="background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8" tabindex="0"><code><span class="line"><span style="color:#032F62;--shiki-dark:#9ECBFF">---</span></span>
|
|
139
|
+
<span class="line"><span style="color:#22863A;--shiki-dark:#85E89D">title</span><span style="color:#24292E;--shiki-dark:#E1E4E8">: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">Demo</span></span>
|
|
140
|
+
<span class="line"><span style="color:#22863A;--shiki-dark:#85E89D">description</span><span style="color:#24292E;--shiki-dark:#E1E4E8">: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">Interactive component</span></span>
|
|
141
|
+
<span class="line"><span style="color:#032F62;--shiki-dark:#9ECBFF">---</span></span>
|
|
142
|
+
<span class="line"></span>
|
|
143
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">import Counter from './components/Counter.tsx'</span></span>
|
|
144
|
+
<span class="line"></span>
|
|
145
|
+
<span class="line"><span style="color:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold">## Counter</span></span>
|
|
146
|
+
<span class="line"></span>
|
|
147
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"><Counter initial={3} /></span></span></code></pre><p>Import components relative to the MDX file. <code>##</code> and <code>###</code> headings feed the on-page outline (with <code>layout: doc</code>).</p>
|
|
148
|
+
<p>Example in this starter: <a href="/interactive">Interactive MDX</a>.</p>
|
|
149
|
+
<h2 id="add-to-navigation" class="pp-heading">Add to navigation<a class="pp-heading-anchor" href="#add-to-navigation" aria-label="Link to this section">#</a></h2>
|
|
150
|
+
<p>New pages do <strong>not</strong> appear in the header or sidebar automatically. Register them in <code>.preactpress/config.ts</code>:</p>
|
|
151
|
+
<pre class="shiki shiki-themes github-light github-dark" style="background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8" tabindex="0"><code><span class="line"><span style="color:#D73A49;--shiki-dark:#F97583">export</span><span style="color:#D73A49;--shiki-dark:#F97583"> default</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
|
|
152
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> themeConfig: {</span></span>
|
|
153
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> nav: [</span></span>
|
|
154
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> { text: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">'Home'</span><span style="color:#24292E;--shiki-dark:#E1E4E8">, link: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">'/'</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
155
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> { text: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">'Contact'</span><span style="color:#24292E;--shiki-dark:#E1E4E8">, link: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">'/contact'</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> }</span></span>
|
|
156
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> ],</span></span>
|
|
157
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> sidebar: [</span></span>
|
|
158
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
|
|
159
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> text: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">'Guide'</span><span style="color:#24292E;--shiki-dark:#E1E4E8">,</span></span>
|
|
160
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> items: [</span></span>
|
|
161
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> { text: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">'Creating pages'</span><span style="color:#24292E;--shiki-dark:#E1E4E8">, link: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">'/guide/creating-pages'</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
162
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> { text: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">'Contact'</span><span style="color:#24292E;--shiki-dark:#E1E4E8">, link: </span><span style="color:#032F62;--shiki-dark:#9ECBFF">'/contact'</span><span style="color:#24292E;--shiki-dark:#E1E4E8"> }</span></span>
|
|
163
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> ]</span></span>
|
|
164
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> }</span></span>
|
|
165
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> ]</span></span>
|
|
166
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8"> }</span></span>
|
|
167
|
+
<span class="line"><span style="color:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre><p>For multilingual sites (<code>locales</code>), put <code>nav</code> and <code>sidebar</code> in each locale block — see <a href="/guide/getting-started">Getting Started</a>.</p>
|
|
168
|
+
<h2 id="translated-page-locale" class="pp-heading">Translated page (locale)<a class="pp-heading-anchor" href="#translated-page-locale" aria-label="Link to this section">#</a></h2>
|
|
169
|
+
<p>With locales configured, add translations in language folders:</p>
|
|
170
|
+
<pre class="shiki shiki-themes github-light github-dark" style="background-color:#fff;--shiki-dark-bg:#24292e;color:#24292e;--shiki-dark:#e1e4e8" tabindex="0"><code><span class="line"><span>contact.md -> /contact</span></span>
|
|
171
|
+
<span class="line"><span>de/contact.md -> /de/contact</span></span></code></pre><p>Each locale is a <strong>separate file</strong>, not an alias of the default page.</p>
|
|
172
|
+
<h2 id="drafts-and-validation" class="pp-heading">Drafts and validation<a class="pp-heading-anchor" href="#drafts-and-validation" aria-label="Link to this section">#</a></h2>
|
|
173
|
+
<ul>
|
|
174
|
+
<li><strong><code>draft: true</code></strong> in frontmatter: visible in dev only, excluded from production builds.</li>
|
|
175
|
+
<li><strong><code>pnpm run check</code></strong>: validates missing links, unknown layouts, route collisions, and warns on drafts without descriptions.</li>
|
|
176
|
+
</ul>
|
|
177
|
+
<h2 id="common-issues" class="pp-heading">Common issues<a class="pp-heading-anchor" href="#common-issues" aria-label="Link to this section">#</a></h2>
|
|
178
|
+
<table>
|
|
179
|
+
<thead>
|
|
180
|
+
<tr>
|
|
181
|
+
<th>Problem</th>
|
|
182
|
+
<th>Fix</th>
|
|
183
|
+
</tr>
|
|
184
|
+
</thead>
|
|
185
|
+
<tbody>
|
|
186
|
+
<tr>
|
|
187
|
+
<td>Page returns 404</td>
|
|
188
|
+
<td><code>.md</code> / <code>.mdx</code> extension? File under <code>srcDir</code>? Dev server running?</td>
|
|
189
|
+
</tr>
|
|
190
|
+
<tr>
|
|
191
|
+
<td>Markdown link broken</td>
|
|
192
|
+
<td>Omit extension: <code>/guide/foo</code>, not <code>/guide/foo.md</code></td>
|
|
193
|
+
</tr>
|
|
194
|
+
<tr>
|
|
195
|
+
<td>Duplicate URL</td>
|
|
196
|
+
<td>Two files must not map to the same route (e.g. <code>foo.md</code> and <code>foo/index.md</code>)</td>
|
|
197
|
+
</tr>
|
|
198
|
+
<tr>
|
|
199
|
+
<td>Page missing from nav</td>
|
|
200
|
+
<td>Add to <code>nav</code> / <code>sidebar</code> in config</td>
|
|
201
|
+
</tr>
|
|
202
|
+
</tbody>
|
|
203
|
+
</table>
|
|
204
|
+
<h2 id="next-steps" class="pp-heading">Next steps<a class="pp-heading-anchor" href="#next-steps" aria-label="Link to this section">#</a></h2>
|
|
205
|
+
<table>
|
|
206
|
+
<thead>
|
|
207
|
+
<tr>
|
|
208
|
+
<th>Topic</th>
|
|
209
|
+
<th>Link</th>
|
|
210
|
+
</tr>
|
|
211
|
+
</thead>
|
|
212
|
+
<tbody>
|
|
213
|
+
<tr>
|
|
214
|
+
<td>First changes in 5 minutes</td>
|
|
215
|
+
<td><a href="/guide/first-five-minutes">Your first 5 minutes</a></td>
|
|
216
|
+
</tr>
|
|
217
|
+
<tr>
|
|
218
|
+
<td>Routing, <code>srcDir</code>, tags</td>
|
|
219
|
+
<td><a href="/guide/routing">Routing</a></td>
|
|
220
|
+
</tr>
|
|
221
|
+
<tr>
|
|
222
|
+
<td>Markdown syntax</td>
|
|
223
|
+
<td><a href="/markdown-examples">Markdown examples</a></td>
|
|
224
|
+
</tr>
|
|
225
|
+
<tr>
|
|
226
|
+
<td>Production build</td>
|
|
227
|
+
<td><a href="/guide/deploy">Deploy</a></td>
|
|
228
|
+
</tr>
|
|
229
|
+
</tbody>
|
|
230
|
+
</table>
|
|
231
|
+
</div><nav class="hn-pager" aria-label="Page navigation"><a class="previous" href="/guide/first-five-minutes"><span>Previous</span>Your first 5 minutes</a><a class="next" href="/guide/commands"><span>Next</span>Commands</a></nav><footer class="hn-doc-meta"><span>Updated Jun 5, 2026</span></footer></article></main><aside class="hn-outline" aria-label="On this page"><div class="hn-outline-panel"><h2>On this page</h2><ul><li class="level-2"><a href="#quick-overview">Quick overview</a></li><li class="level-2"><a href="#step-by-step-a-simple-page">Step by step: a simple page</a></li><li class="level-2"><a href="#file-location-url">File location → URL</a></li><li class="level-2"><a href="#source-directory-srcdir">Source directory (srcDir)</a></li><li class="level-2"><a href="#frontmatter-optional-but-recommended">Frontmatter (optional but recommended)</a></li><li class="level-2"><a href="#mdx-pages-with-components">MDX pages with components</a></li><li class="level-2"><a href="#add-to-navigation">Add to navigation</a></li><li class="level-2"><a href="#translated-page-locale">Translated page (locale)</a></li><li class="level-2"><a href="#drafts-and-validation">Drafts and validation</a></li><li class="level-2"><a href="#common-issues">Common issues</a></li><li class="level-2"><a href="#next-steps">Next steps</a></li></ul></div></aside></div><footer class="hn-footer">Built with PreactPress.</footer></div></div>
|
|
232
|
+
<script type="module" crossorigin src="/assets/main-Bqi-VFEk.js"></script>
|
|
233
|
+
</body>
|
|
234
|
+
</html>
|