@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,67 @@
|
|
|
1
|
+
import type { NavItem, ResolvedI18n, SidebarGroup, SidebarItem } from '../node/siteConfig.js'
|
|
2
|
+
import { routePathKey } from './locale.js'
|
|
3
|
+
import { normalizeRoute } from './route.js'
|
|
4
|
+
|
|
5
|
+
export type SidebarConfig = SidebarGroup[] | Record<string, SidebarGroup[]>
|
|
6
|
+
|
|
7
|
+
export function isPathSidebarConfig(
|
|
8
|
+
sidebar: SidebarConfig | undefined
|
|
9
|
+
): sidebar is Record<string, SidebarGroup[]> {
|
|
10
|
+
return Boolean(sidebar && !Array.isArray(sidebar))
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function resolveSidebarForRoute(
|
|
14
|
+
sidebar: SidebarConfig | undefined,
|
|
15
|
+
route: string,
|
|
16
|
+
i18n?: ResolvedI18n
|
|
17
|
+
): SidebarGroup[] {
|
|
18
|
+
if (!sidebar) return []
|
|
19
|
+
if (Array.isArray(sidebar)) return sidebar
|
|
20
|
+
|
|
21
|
+
const pathKey = routePathKey(route, i18n)
|
|
22
|
+
const entries = Object.entries(sidebar)
|
|
23
|
+
.map(([prefix, groups]) => ({ prefix: normalizeRoute(prefix), groups }))
|
|
24
|
+
.filter(({ prefix }) => prefix !== '/')
|
|
25
|
+
.sort((a, b) => b.prefix.length - a.prefix.length)
|
|
26
|
+
|
|
27
|
+
for (const { prefix, groups } of entries) {
|
|
28
|
+
if (pathKey === prefix || pathKey.startsWith(`${prefix}/`)) {
|
|
29
|
+
return groups
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return sidebar['/'] ?? sidebar[''] ?? []
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function flattenSidebarLeafItems(
|
|
37
|
+
items: SidebarItem[]
|
|
38
|
+
): Array<{ text: string; link: string }> {
|
|
39
|
+
const out: Array<{ text: string; link: string }> = []
|
|
40
|
+
for (const item of items) {
|
|
41
|
+
if (item.link) out.push({ text: item.text, link: item.link })
|
|
42
|
+
if (item.items?.length) out.push(...flattenSidebarLeafItems(item.items))
|
|
43
|
+
}
|
|
44
|
+
return out
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function flattenSidebarItems(
|
|
48
|
+
sidebar: SidebarConfig | undefined
|
|
49
|
+
): Array<{ text: string; link: string }> {
|
|
50
|
+
return allSidebarGroups(sidebar).flatMap((group) => flattenSidebarLeafItems(group.items))
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function flattenNavLeafItems(
|
|
54
|
+
items: NavItem[] | undefined
|
|
55
|
+
): Array<{ text: string; link: string }> {
|
|
56
|
+
const out: Array<{ text: string; link: string }> = []
|
|
57
|
+
for (const item of items ?? []) {
|
|
58
|
+
if (item.link) out.push({ text: item.text, link: item.link })
|
|
59
|
+
if (item.items?.length) out.push(...flattenNavLeafItems(item.items))
|
|
60
|
+
}
|
|
61
|
+
return out
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function allSidebarGroups(sidebar: SidebarConfig | undefined): SidebarGroup[] {
|
|
65
|
+
if (!sidebar) return []
|
|
66
|
+
return Array.isArray(sidebar) ? sidebar : Object.values(sidebar).flat()
|
|
67
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { OutlineItem } from '../node/siteConfig.js'
|
|
2
|
+
|
|
3
|
+
export function slugifySegment(text: string, fallback = 'section'): string {
|
|
4
|
+
const slug = text
|
|
5
|
+
.toLowerCase()
|
|
6
|
+
.trim()
|
|
7
|
+
.replace(/<[^>]+>/g, '')
|
|
8
|
+
.replace(/&[a-z0-9#]+;/gi, '')
|
|
9
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
10
|
+
.replace(/^-+|-+$/g, '')
|
|
11
|
+
return slug || fallback
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function uniqueSlug(base: string, existing: OutlineItem[]): string {
|
|
15
|
+
let id = base
|
|
16
|
+
let i = 1
|
|
17
|
+
const used = new Set(existing.map((h) => h.id))
|
|
18
|
+
while (used.has(id)) {
|
|
19
|
+
i += 1
|
|
20
|
+
id = `${base}-${i}`
|
|
21
|
+
}
|
|
22
|
+
return id
|
|
23
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Built-in simple-icons-style SVGs for common `themeConfig.socialLinks` icons. */
|
|
2
|
+
export const SOCIAL_ICON_SVGS: Record<string, string> = {
|
|
3
|
+
github:
|
|
4
|
+
'<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>',
|
|
5
|
+
gitlab:
|
|
6
|
+
'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitLab</title><path fill="currentColor" d="m23.955 13.587-.035-.086L20.55 2.395A.795.795 0 0 0 19.786 2H4.214a.795.795 0 0 0-.764.395L.08 13.501l-.035.086a6.015 6.015 0 0 0 2.13 6.953l.011.008.03.022 5.08 3.802.03.022.011.008a6.014 6.014 0 0 0 11.73 0l.011-.008.03-.022 5.08-3.802.03-.022.011-.008a6.015 6.015 0 0 0 2.13-6.953Z"/></svg>',
|
|
7
|
+
discord:
|
|
8
|
+
'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Discord</title><path fill="currentColor" d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286z"/></svg>',
|
|
9
|
+
twitter:
|
|
10
|
+
'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>X</title><path fill="currentColor" d="M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"/></svg>',
|
|
11
|
+
x:
|
|
12
|
+
'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>X</title><path fill="currentColor" d="M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"/></svg>',
|
|
13
|
+
mastodon:
|
|
14
|
+
'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Mastodon</title><path fill="currentColor" d="M23.268 5.313c-.35-2.578-2.858-4.532-5.573-4.776-2.005-.18-3.927.586-5.01 1.776-1.083-1.19-3.005-1.956-5.01-1.776C4.97.781 2.462 2.735 2.112 5.313c-.372 2.75-.372 5.75 0 8.5.35 2.578 2.858 4.532 5.573 4.776 2.005.18 3.927-.586 5.01-1.776 1.083 1.19 3.005 1.956 5.01 1.776 2.715-.244 5.223-2.198 5.573-4.776.372-2.75.372-5.75 0-8.5ZM8.708 15.855c-1.365 0-2.47-1.105-2.47-2.47s1.105-2.47 2.47-2.47 2.47 1.105 2.47 2.47-1.105 2.47-2.47 2.47Zm6.584 0c-1.365 0-2.47-1.105-2.47-2.47s1.105-2.47 2.47-2.47 2.47 1.105 2.47 2.47-1.105 2.47-2.47 2.47Z"/></svg>',
|
|
15
|
+
bluesky:
|
|
16
|
+
'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Bluesky</title><path fill="currentColor" d="M12 10.8c-1.087-2.114-4.046-6.053-6.798-7.995C2.566.944 1.561 1.266.902 1.565.139 1.908 0 3.08 0 3.768c0 .69.378 5.65.624 6.479.815 2.736 3.713 3.66 6.387 3.364.136-.02.275-.039.415-.056-.138.022-.276.04-.415.056-3.912.58-7.387 2.526-2.833 8.916 4.777 6.508 6.547-1.423 7.447-5.46.9 4.037 2.67 11.968 7.447 5.46 4.37-5.946 1.053-8.337-2.833-8.916.139.016.277.034.415.056 2.674.297 5.572-.628 6.387-3.364.246-.828.624-5.79.624-6.478 0-.69-.139-1.861-.902-2.206-.659-.298-1.664-.62-4.3 1.24C16.046 4.748 13.087 8.687 12 10.8Z"/></svg>',
|
|
17
|
+
linkedin:
|
|
18
|
+
'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>LinkedIn</title><path fill="currentColor" d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>',
|
|
19
|
+
youtube:
|
|
20
|
+
'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>YouTube</title><path fill="currentColor" d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>',
|
|
21
|
+
slack:
|
|
22
|
+
'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Slack</title><path fill="currentColor" d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/></svg>',
|
|
23
|
+
npm:
|
|
24
|
+
'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>npm</title><path fill="currentColor" d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0ZM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113Z"/></svg>'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type SocialLinkIcon = string | { svg: string }
|
|
28
|
+
|
|
29
|
+
export interface SocialLink {
|
|
30
|
+
icon: SocialLinkIcon
|
|
31
|
+
link: string
|
|
32
|
+
ariaLabel?: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function socialIconSvg(icon: SocialLinkIcon): string | undefined {
|
|
36
|
+
if (typeof icon === 'object') return icon.svg
|
|
37
|
+
return SOCIAL_ICON_SVGS[icon.toLowerCase()]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function socialLinkLabel(icon: SocialLinkIcon, ariaLabel?: string): string {
|
|
41
|
+
if (ariaLabel) return ariaLabel
|
|
42
|
+
if (typeof icon === 'string') return icon
|
|
43
|
+
return 'Social link'
|
|
44
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { normalizeRoute } from './route.js'
|
|
2
|
+
import { slugifySegment } from './slug.js'
|
|
3
|
+
|
|
4
|
+
/** URL path segment for a tag (lowercase, hyphenated ASCII). */
|
|
5
|
+
export function slugifyTagSegment(tag: string): string {
|
|
6
|
+
return slugifySegment(tag, '')
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function parseTagsField(value: unknown): string[] {
|
|
10
|
+
if (value == null) return []
|
|
11
|
+
if (typeof value === 'string') return value.trim() ? [value.trim()] : []
|
|
12
|
+
if (!Array.isArray(value)) return []
|
|
13
|
+
const out: string[] = []
|
|
14
|
+
for (const v of value) {
|
|
15
|
+
if (typeof v === 'string' && v.trim()) out.push(v.trim())
|
|
16
|
+
else if (typeof v === 'number' || typeof v === 'boolean') out.push(String(v))
|
|
17
|
+
}
|
|
18
|
+
return out
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function resolvePageTags(meta: Record<string, unknown>): string[] {
|
|
22
|
+
const seen = new Set<string>()
|
|
23
|
+
const out: string[] = []
|
|
24
|
+
for (const tag of [...parseTagsField(meta.tags), ...parseTagsField(meta.tag)]) {
|
|
25
|
+
const slug = slugifyTagSegment(tag)
|
|
26
|
+
if (!slug || seen.has(slug)) continue
|
|
27
|
+
seen.add(slug)
|
|
28
|
+
out.push(tag.trim())
|
|
29
|
+
}
|
|
30
|
+
return out
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function tagIndexPageRoute(slug: string, prefix = ''): string {
|
|
34
|
+
const cleanPrefix = prefix ? normalizeRoute(prefix) : ''
|
|
35
|
+
return normalizeRoute(`${cleanPrefix}/tags/${slug}`)
|
|
36
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const PREACTPRESS_THEME_STORAGE_KEY = 'preactpress-theme' as const
|
|
2
|
+
export const PREACTPRESS_THEME_SCRIPT = 'preactpress-theme.js' as const
|
|
3
|
+
|
|
4
|
+
export type PreactpressStoredTheme = 'light' | 'dark'
|
|
5
|
+
|
|
6
|
+
export function readStoredTheme(): PreactpressStoredTheme | null {
|
|
7
|
+
if (typeof localStorage === 'undefined') return null
|
|
8
|
+
try {
|
|
9
|
+
const v = localStorage.getItem(PREACTPRESS_THEME_STORAGE_KEY)
|
|
10
|
+
return v === 'light' || v === 'dark' ? v : null
|
|
11
|
+
} catch {
|
|
12
|
+
return null
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function applyTheme(theme: PreactpressStoredTheme | null): void {
|
|
17
|
+
if (typeof document === 'undefined') return
|
|
18
|
+
const root = document.documentElement
|
|
19
|
+
if (theme === null) root.removeAttribute('data-theme')
|
|
20
|
+
else root.setAttribute('data-theme', theme)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Synced into dev `index.html` (via Vite plugin) and production HTML (`build.ts`) before first paint. */
|
|
24
|
+
export const PREACTPRESS_THEME_BOOT_SCRIPT = `(function(){try{var k=${JSON.stringify(
|
|
25
|
+
PREACTPRESS_THEME_STORAGE_KEY
|
|
26
|
+
)};var m=localStorage.getItem(k);if(m==='light'||m==='dark')document.documentElement.setAttribute('data-theme',m);}catch(e){}})();`
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ThemeLabels } from '../node/siteConfig.js'
|
|
2
|
+
|
|
3
|
+
export interface ResolvedThemeLabels {
|
|
4
|
+
skip: string
|
|
5
|
+
navigation: string
|
|
6
|
+
menu: string
|
|
7
|
+
closeMenu: string
|
|
8
|
+
search: string
|
|
9
|
+
filterPages: string
|
|
10
|
+
searchResults: string
|
|
11
|
+
previous: string
|
|
12
|
+
next: string
|
|
13
|
+
lastUpdated: string
|
|
14
|
+
onThisPage: string
|
|
15
|
+
language: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const EN_LABELS: ResolvedThemeLabels = {
|
|
19
|
+
skip: 'Skip to content',
|
|
20
|
+
navigation: 'Navigation',
|
|
21
|
+
menu: 'Menu',
|
|
22
|
+
closeMenu: 'Close menu',
|
|
23
|
+
search: 'Search',
|
|
24
|
+
filterPages: 'Filter pages',
|
|
25
|
+
searchResults: 'Search results',
|
|
26
|
+
previous: 'Previous',
|
|
27
|
+
next: 'Next',
|
|
28
|
+
lastUpdated: 'Last updated',
|
|
29
|
+
onThisPage: 'On this page',
|
|
30
|
+
language: 'Language'
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const DE_LABELS: ResolvedThemeLabels = {
|
|
34
|
+
skip: 'Zum Inhalt springen',
|
|
35
|
+
navigation: 'Navigation',
|
|
36
|
+
menu: 'Menü',
|
|
37
|
+
closeMenu: 'Menü schließen',
|
|
38
|
+
search: 'Suche',
|
|
39
|
+
filterPages: 'Seiten filtern',
|
|
40
|
+
searchResults: 'Suchergebnisse',
|
|
41
|
+
previous: 'Zurück',
|
|
42
|
+
next: 'Weiter',
|
|
43
|
+
lastUpdated: 'Zuletzt aktualisiert',
|
|
44
|
+
onThisPage: 'Auf dieser Seite',
|
|
45
|
+
language: 'Sprache'
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function defaultLabelsForLang(lang: string): ResolvedThemeLabels {
|
|
49
|
+
return lang.toLowerCase().startsWith('de') ? DE_LABELS : EN_LABELS
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function resolveThemeLabels(
|
|
53
|
+
lang: string,
|
|
54
|
+
overrides: ThemeLabels | undefined
|
|
55
|
+
): ResolvedThemeLabels {
|
|
56
|
+
const defaults = defaultLabelsForLang(lang)
|
|
57
|
+
if (!overrides) return defaults
|
|
58
|
+
return {
|
|
59
|
+
skip: overrides.skip ?? defaults.skip,
|
|
60
|
+
navigation: overrides.navigation ?? defaults.navigation,
|
|
61
|
+
menu: overrides.menu ?? defaults.menu,
|
|
62
|
+
closeMenu: overrides.closeMenu ?? defaults.closeMenu,
|
|
63
|
+
search: overrides.search ?? defaults.search,
|
|
64
|
+
filterPages: overrides.filterPages ?? defaults.filterPages,
|
|
65
|
+
searchResults: overrides.searchResults ?? defaults.searchResults,
|
|
66
|
+
previous: overrides.previous ?? defaults.previous,
|
|
67
|
+
next: overrides.next ?? defaults.next,
|
|
68
|
+
lastUpdated: overrides.lastUpdated ?? defaults.lastUpdated,
|
|
69
|
+
onThisPage: overrides.onThisPage ?? defaults.onThisPage,
|
|
70
|
+
language: overrides.language ?? defaults.language
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function publicUrl(siteBase: string, file: string): string {
|
|
2
|
+
const b = siteBase === '/' ? '' : siteBase.replace(/\/$/, '')
|
|
3
|
+
const f = file.startsWith('/') ? file : `/${file}`
|
|
4
|
+
return `${b}${f}`
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function canonicalUrl(opts: {
|
|
8
|
+
url?: string
|
|
9
|
+
base: string
|
|
10
|
+
route: string
|
|
11
|
+
}): string {
|
|
12
|
+
const path = publicUrl(opts.base, opts.route === '/' ? '/' : `${opts.route}/`)
|
|
13
|
+
return opts.url ? `${opts.url}${path}` : path
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineConfig } from '@kamod-ch/preactpress/config'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
srcExclude: ['README.md', 'partials/**', 'parts/**'],
|
|
5
|
+
site: {
|
|
6
|
+
title: 'My PreactPress Site',
|
|
7
|
+
description: 'A simple static site built with PreactPress'
|
|
8
|
+
},
|
|
9
|
+
markdown: {
|
|
10
|
+
html: false
|
|
11
|
+
},
|
|
12
|
+
themeConfig: {
|
|
13
|
+
outline: true,
|
|
14
|
+
search: true,
|
|
15
|
+
footer: 'Built with PreactPress.',
|
|
16
|
+
nav: [
|
|
17
|
+
{ text: 'Home', link: '/' },
|
|
18
|
+
{ text: 'About', link: '/about' }
|
|
19
|
+
],
|
|
20
|
+
sidebar: [
|
|
21
|
+
{
|
|
22
|
+
text: 'Start',
|
|
23
|
+
items: [
|
|
24
|
+
{ text: 'Home', link: '/' },
|
|
25
|
+
{ text: 'About', link: '/about' },
|
|
26
|
+
{ text: 'Your first 5 minutes', link: '/guide/first-five-minutes' }
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
})
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# PreactPress starter site
|
|
2
|
+
|
|
3
|
+
This folder was scaffolded with `preactpress init`. It is the minimal starter: a home page, an about page, and one short guide.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
| Script | What it does |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| `pnpm run dev` | Start the dev server at http://localhost:5173 |
|
|
10
|
+
| `pnpm run check` | Validate config, routes, and links |
|
|
11
|
+
| `pnpm run build` | Write static HTML to `dist/` |
|
|
12
|
+
| `pnpm run preview` | Serve the production build locally |
|
|
13
|
+
|
|
14
|
+
## Where to edit
|
|
15
|
+
|
|
16
|
+
| Path | Purpose |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `*.md`, `*.mdx` | Page content — file path becomes the URL |
|
|
19
|
+
| `.preactpress/config.ts` | Site title, nav, sidebar, build options |
|
|
20
|
+
| `index.html` | Vite entry (rarely edited) |
|
|
21
|
+
|
|
22
|
+
## Layout examples
|
|
23
|
+
|
|
24
|
+
The default starter shows all built-in default-theme layouts:
|
|
25
|
+
|
|
26
|
+
| File | Layout |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| `index.md` | `layout: home` |
|
|
29
|
+
| `about.md` | `layout: page` |
|
|
30
|
+
| `guide/first-five-minutes.md` | `layout: doc` |
|
|
31
|
+
|
|
32
|
+
Start with [Your first 5 minutes](/guide/first-five-minutes) in the local site, or read the full PreactPress README in the npm package / repository.
|
|
33
|
+
|
|
34
|
+
For a larger documentation starter, run `preactpress init --template docs`. For a custom magazine-style theme, run `preactpress init --template magazine`.
|
|
35
|
+
|
|
36
|
+
## Deploy
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm run check
|
|
40
|
+
pnpm run build
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Upload **only** `dist/` to Netlify, Vercel, Cloudflare Pages, GitHub Pages, or any static host. No Node server is required in production.
|
|
44
|
+
|
|
45
|
+
Before the first production build, set `site.url` (and `site.base` for subpath hosting) in `.preactpress/config.ts`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: About
|
|
3
|
+
description: About this site
|
|
4
|
+
layout: page
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# About us
|
|
8
|
+
|
|
9
|
+
Your content here.
|
|
10
|
+
|
|
11
|
+
This page was added as part of the [Your first 5 minutes](/guide/first-five-minutes) tutorial. Replace this text with your own copy — team bio, project mission, contact details, or anything else that belongs on an About page.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Your first 5 minutes
|
|
3
|
+
description: Change the site title, add a page, and update navigation
|
|
4
|
+
layout: doc
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Your first 5 minutes
|
|
8
|
+
|
|
9
|
+
This hands-on tutorial walks through the smallest useful PreactPress workflow. Follow the steps below in **your** project — this starter already includes the finished result.
|
|
10
|
+
|
|
11
|
+
## 1. Change the site title
|
|
12
|
+
|
|
13
|
+
Edit `.preactpress/config.ts`:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
export default {
|
|
17
|
+
site: {
|
|
18
|
+
title: 'My Docs',
|
|
19
|
+
description: 'Short summary for search and social previews'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Save the file. The dev server picks up config changes on the next request.
|
|
25
|
+
|
|
26
|
+
## 2. Add a page
|
|
27
|
+
|
|
28
|
+
Create `about.md`:
|
|
29
|
+
|
|
30
|
+
```md
|
|
31
|
+
---
|
|
32
|
+
title: About
|
|
33
|
+
description: About this site
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
# About us
|
|
37
|
+
|
|
38
|
+
Your content here.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
PreactPress serves it at `/about`. Every `.md` or `.mdx` file under `srcDir` (default: project root) becomes a URL automatically.
|
|
42
|
+
|
|
43
|
+
Example: `news/2025/intro.md` → `/news/2025/intro`.
|
|
44
|
+
|
|
45
|
+
This starter already includes [About](/about) so you can see the finished page.
|
|
46
|
+
|
|
47
|
+
## 3. Add it to the navigation
|
|
48
|
+
|
|
49
|
+
In `.preactpress/config.ts`:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
export default {
|
|
53
|
+
site: { title: 'My Docs' },
|
|
54
|
+
themeConfig: {
|
|
55
|
+
nav: [
|
|
56
|
+
{ text: 'Home', link: '/' },
|
|
57
|
+
{ text: 'About', link: '/about' }
|
|
58
|
+
],
|
|
59
|
+
sidebar: [
|
|
60
|
+
{
|
|
61
|
+
text: 'Guide',
|
|
62
|
+
items: [
|
|
63
|
+
{ text: 'Home', link: '/' },
|
|
64
|
+
{ text: 'About', link: '/about' }
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Save — the dev server hot-reloads your changes.
|
|
73
|
+
|
|
74
|
+
## Next steps
|
|
75
|
+
|
|
76
|
+
| Command | Purpose |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| `pnpm run dev` | Dev server with SSR and hot reload |
|
|
79
|
+
| `pnpm run check` | Validate config, links, and routes |
|
|
80
|
+
| `pnpm run build` | Static production build → `dist/` |
|
|
81
|
+
| `pnpm run preview` | Local preview of the build |
|
|
82
|
+
|
|
83
|
+
Before deploying, set `site.url` in config for canonical URLs, Open Graph tags, and `sitemap.xml`. Read the package README for routing, MDX, deployment, and custom theme details.
|
|
@@ -0,0 +1,18 @@
|
|
|
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>PreactPress</title>
|
|
7
|
+
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
|
8
|
+
<link rel="icon" href="/favicon-32.png" type="image/png" sizes="32x32" />
|
|
9
|
+
<link rel="icon" href="/favicon.png" type="image/png" />
|
|
10
|
+
<link rel="apple-touch-icon" href="/favicon.png" />
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="app"></div>
|
|
14
|
+
<script type="module">
|
|
15
|
+
import 'preactpress/app'
|
|
16
|
+
</script>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Welcome
|
|
3
|
+
description: Get started with PreactPress in minutes
|
|
4
|
+
layout: home
|
|
5
|
+
hero:
|
|
6
|
+
name: PreactPress
|
|
7
|
+
text: Vite and Preact powered static sites
|
|
8
|
+
tagline: Write Markdown and MDX, configure navigation, and ship a small static documentation site.
|
|
9
|
+
actions:
|
|
10
|
+
- theme: brand
|
|
11
|
+
text: Get started
|
|
12
|
+
link: /guide/first-five-minutes
|
|
13
|
+
- theme: alt
|
|
14
|
+
text: About this site
|
|
15
|
+
link: /about
|
|
16
|
+
features:
|
|
17
|
+
- icon: V
|
|
18
|
+
title: Fast by default
|
|
19
|
+
details: Static HTML output, Vite dev server, and optional client navigation.
|
|
20
|
+
- icon: M
|
|
21
|
+
title: Markdown first
|
|
22
|
+
details: Frontmatter, MDX, tags, search metadata, and outline extraction.
|
|
23
|
+
- icon: T
|
|
24
|
+
title: Themeable
|
|
25
|
+
details: Use the default theme or replace it with your own Preact layout.
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Quick start
|
|
29
|
+
|
|
30
|
+
From this folder:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pnpm install
|
|
34
|
+
pnpm run dev
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Open **http://localhost:5173**. Edit Markdown files, adjust `.preactpress/config.ts`, and the dev server hot-reloads your changes.
|
|
38
|
+
|
|
39
|
+
## What to read next
|
|
40
|
+
|
|
41
|
+
| Page | Why |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| [Your first 5 minutes](/guide/first-five-minutes) | Change the title, add a page, wire up navigation |
|
|
44
|
+
| [About](/about) | A plain content page you can replace |
|
|
45
|
+
|
|
46
|
+
## What you get
|
|
47
|
+
|
|
48
|
+
| Feature | Included |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| Static HTML build | Yes |
|
|
51
|
+
| Client navigation | Yes |
|
|
52
|
+
| Markdown frontmatter | Yes |
|
|
53
|
+
| Sidebar search | Yes |
|
|
54
|
+
|
|
55
|
+
The default template is intentionally small. Use `preactpress init --template docs` when you want a fuller documentation starter, or `preactpress init --template magazine` for a custom-theme example.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "preactpress-starter",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "preactpress dev",
|
|
7
|
+
"check": "preactpress check",
|
|
8
|
+
"build": "preactpress build",
|
|
9
|
+
"preview": "preactpress preview"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@kamod-ch/preactpress": "file:../..",
|
|
13
|
+
"typescript": "^5.8.3"
|
|
14
|
+
}
|
|
15
|
+
}
|