@kamod-ch/preactpress 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -49
- package/bin/preactpress.mjs +5 -5
- package/dist/client/app.d.ts +1 -1
- package/dist/client/app.d.ts.map +1 -1
- package/dist/client/app.js +34 -38
- package/dist/client/app.js.map +1 -1
- package/dist/client/entry-client.js +11 -12
- package/dist/client/entry-client.js.map +1 -1
- package/dist/client/entry-ssr.d.ts +2 -2
- package/dist/client/entry-ssr.d.ts.map +1 -1
- package/dist/client/entry-ssr.js +16 -16
- package/dist/client/entry-ssr.js.map +1 -1
- package/dist/client/index.d.ts +3 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/loadPage.d.ts +1 -1
- package/dist/client/loadPage.d.ts.map +1 -1
- package/dist/client/loadPage.js +12 -12
- package/dist/client/loadPage.js.map +1 -1
- package/dist/client/prefetchLinks.js +4 -4
- package/dist/client/prefetchLinks.js.map +1 -1
- package/dist/client/theme-default/AlgoliaSearch.d.ts +3 -3
- package/dist/client/theme-default/AlgoliaSearch.d.ts.map +1 -1
- package/dist/client/theme-default/AlgoliaSearch.js +15 -15
- package/dist/client/theme-default/AlgoliaSearch.js.map +1 -1
- package/dist/client/theme-default/Features.d.ts +2 -2
- package/dist/client/theme-default/Features.d.ts.map +1 -1
- package/dist/client/theme-default/Features.js +10 -8
- package/dist/client/theme-default/Features.js.map +1 -1
- package/dist/client/theme-default/Hero.d.ts +2 -2
- package/dist/client/theme-default/Hero.d.ts.map +1 -1
- package/dist/client/theme-default/Hero.js +9 -7
- package/dist/client/theme-default/Hero.js.map +1 -1
- package/dist/client/theme-default/Layout.d.ts +3 -3
- package/dist/client/theme-default/Layout.d.ts.map +1 -1
- package/dist/client/theme-default/Layout.js +56 -99
- package/dist/client/theme-default/Layout.js.map +1 -1
- package/dist/client/theme-default/Logo.d.ts +2 -2
- package/dist/client/theme-default/Logo.d.ts.map +1 -1
- package/dist/client/theme-default/Logo.js +8 -8
- package/dist/client/theme-default/Logo.js.map +1 -1
- package/dist/client/theme-default/NavLinks.d.ts +2 -2
- package/dist/client/theme-default/NavLinks.d.ts.map +1 -1
- package/dist/client/theme-default/NavLinks.js +3 -3
- package/dist/client/theme-default/NavLinks.js.map +1 -1
- package/dist/client/theme-default/SidebarNav.d.ts +2 -2
- package/dist/client/theme-default/SidebarNav.d.ts.map +1 -1
- package/dist/client/theme-default/SidebarNav.js +3 -3
- package/dist/client/theme-default/SidebarNav.js.map +1 -1
- package/dist/client/theme-default/SocialLinks.d.ts +2 -2
- package/dist/client/theme-default/SocialLinks.d.ts.map +1 -1
- package/dist/client/theme-default/SocialLinks.js +1 -1
- package/dist/client/theme-default/SocialLinks.js.map +1 -1
- package/dist/client/theme-default/ThemeToggle.d.ts +2 -3
- package/dist/client/theme-default/ThemeToggle.d.ts.map +1 -1
- package/dist/client/theme-default/ThemeToggle.js +2 -30
- package/dist/client/theme-default/ThemeToggle.js.map +1 -1
- package/dist/client/theme-default/index.d.ts +1 -1
- package/dist/client/theme-default/index.d.ts.map +1 -1
- package/dist/client/theme-default/index.js +1 -1
- package/dist/client/theme-default/index.js.map +1 -1
- package/dist/client/theme-utils.d.ts +24 -0
- package/dist/client/theme-utils.d.ts.map +1 -0
- package/dist/client/theme-utils.js +107 -0
- package/dist/client/theme-utils.js.map +1 -0
- package/dist/client/types.d.ts +5 -5
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/usePageHead.d.ts +2 -2
- package/dist/client/usePageHead.d.ts.map +1 -1
- package/dist/client/usePageHead.js +61 -56
- package/dist/client/usePageHead.js.map +1 -1
- package/dist/client/useSiteSearch.d.ts.map +1 -1
- package/dist/client/useSiteSearch.js +8 -8
- package/dist/client/useSiteSearch.js.map +1 -1
- package/dist/node/build.d.ts +1 -1
- package/dist/node/build.d.ts.map +1 -1
- package/dist/node/build.js +105 -96
- package/dist/node/build.js.map +1 -1
- package/dist/node/buildCache.d.ts.map +1 -1
- package/dist/node/buildCache.js +7 -7
- package/dist/node/buildCache.js.map +1 -1
- package/dist/node/check.d.ts +1 -1
- package/dist/node/check.d.ts.map +1 -1
- package/dist/node/check.js +52 -52
- package/dist/node/check.js.map +1 -1
- package/dist/node/cli.js +61 -64
- package/dist/node/cli.js.map +1 -1
- package/dist/node/config-helpers.d.ts +4 -4
- package/dist/node/config-helpers.d.ts.map +1 -1
- package/dist/node/config-helpers.js +1 -1
- package/dist/node/config-helpers.js.map +1 -1
- package/dist/node/config.d.ts +4 -4
- package/dist/node/config.d.ts.map +1 -1
- package/dist/node/config.js +37 -40
- package/dist/node/config.js.map +1 -1
- package/dist/node/content.d.ts +4 -4
- package/dist/node/content.d.ts.map +1 -1
- package/dist/node/content.js +28 -28
- package/dist/node/content.js.map +1 -1
- package/dist/node/createContentLoader.d.ts +1 -1
- package/dist/node/createContentLoader.d.ts.map +1 -1
- package/dist/node/createContentLoader.js +3 -3
- package/dist/node/createContentLoader.js.map +1 -1
- package/dist/node/devCss.d.ts +1 -1
- package/dist/node/devCss.d.ts.map +1 -1
- package/dist/node/devCss.js +5 -6
- package/dist/node/devCss.js.map +1 -1
- package/dist/node/devSsr.d.ts +3 -3
- package/dist/node/devSsr.d.ts.map +1 -1
- package/dist/node/devSsr.js +32 -32
- package/dist/node/devSsr.js.map +1 -1
- package/dist/node/dynamicRoutes.d.ts +2 -2
- package/dist/node/dynamicRoutes.d.ts.map +1 -1
- package/dist/node/dynamicRoutes.js +24 -24
- package/dist/node/dynamicRoutes.js.map +1 -1
- package/dist/node/favicon.d.ts +2 -2
- package/dist/node/favicon.d.ts.map +1 -1
- package/dist/node/favicon.js +26 -24
- package/dist/node/favicon.js.map +1 -1
- package/dist/node/feed.d.ts +2 -2
- package/dist/node/feed.d.ts.map +1 -1
- package/dist/node/feed.js +18 -16
- package/dist/node/feed.js.map +1 -1
- package/dist/node/hooks.d.ts +2 -2
- package/dist/node/hooks.d.ts.map +1 -1
- package/dist/node/hooks.js +1 -1
- package/dist/node/hooks.js.map +1 -1
- package/dist/node/html.d.ts +8 -8
- package/dist/node/html.d.ts.map +1 -1
- package/dist/node/html.js +75 -64
- package/dist/node/html.js.map +1 -1
- package/dist/node/index.d.ts +11 -11
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +8 -8
- package/dist/node/index.js.map +1 -1
- package/dist/node/init.d.ts +2 -0
- package/dist/node/init.d.ts.map +1 -1
- package/dist/node/init.js +59 -27
- package/dist/node/init.js.map +1 -1
- package/dist/node/lastUpdated.d.ts +2 -2
- package/dist/node/lastUpdated.d.ts.map +1 -1
- package/dist/node/lastUpdated.js +7 -4
- package/dist/node/lastUpdated.js.map +1 -1
- package/dist/node/loadSiteModule.js +2 -2
- package/dist/node/loadSiteModule.js.map +1 -1
- package/dist/node/markdown.d.ts +2 -2
- package/dist/node/markdown.d.ts.map +1 -1
- package/dist/node/markdown.js +110 -110
- package/dist/node/markdown.js.map +1 -1
- package/dist/node/markdownHeadings.d.ts +1 -1
- package/dist/node/markdownHeadings.d.ts.map +1 -1
- package/dist/node/markdownHeadings.js +11 -11
- package/dist/node/markdownHeadings.js.map +1 -1
- package/dist/node/markdownInclude.d.ts.map +1 -1
- package/dist/node/markdownInclude.js +11 -11
- package/dist/node/markdownInclude.js.map +1 -1
- package/dist/node/markdownSnippets.d.ts.map +1 -1
- package/dist/node/markdownSnippets.js +34 -34
- package/dist/node/markdownSnippets.js.map +1 -1
- package/dist/node/mdx.d.ts +1 -1
- package/dist/node/mdx.d.ts.map +1 -1
- package/dist/node/mdx.js +4 -4
- package/dist/node/mdx.js.map +1 -1
- package/dist/node/packageRoot.d.ts.map +1 -1
- package/dist/node/packageRoot.js +4 -4
- package/dist/node/packageRoot.js.map +1 -1
- package/dist/node/pageDataLoaders.d.ts +2 -2
- package/dist/node/pageDataLoaders.d.ts.map +1 -1
- package/dist/node/pageDataLoaders.js +24 -20
- package/dist/node/pageDataLoaders.js.map +1 -1
- package/dist/node/paths.d.ts.map +1 -1
- package/dist/node/paths.js +4 -4
- package/dist/node/paths.js.map +1 -1
- package/dist/node/plugin.d.ts +3 -3
- package/dist/node/plugin.d.ts.map +1 -1
- package/dist/node/plugin.js +66 -66
- package/dist/node/plugin.js.map +1 -1
- package/dist/node/resolveDeps.js +10 -10
- package/dist/node/resolveDeps.js.map +1 -1
- package/dist/node/serve.d.ts.map +1 -1
- package/dist/node/serve.js +13 -15
- package/dist/node/serve.js.map +1 -1
- package/dist/node/server.d.ts +3 -3
- package/dist/node/server.d.ts.map +1 -1
- package/dist/node/server.js +28 -25
- package/dist/node/server.js.map +1 -1
- package/dist/node/siteConfig.d.ts +12 -12
- package/dist/node/siteConfig.d.ts.map +1 -1
- package/dist/node/tagIndex.d.ts +5 -5
- package/dist/node/tagIndex.d.ts.map +1 -1
- package/dist/node/tagIndex.js +10 -10
- package/dist/node/tagIndex.js.map +1 -1
- package/dist/shared/contentChunk.d.ts.map +1 -1
- package/dist/shared/contentChunk.js +6 -6
- package/dist/shared/contentChunk.js.map +1 -1
- package/dist/shared/contentSchema.d.ts.map +1 -1
- package/dist/shared/contentSchema.js +11 -11
- package/dist/shared/contentSchema.js.map +1 -1
- package/dist/shared/deadLinks.d.ts.map +1 -1
- package/dist/shared/deadLinks.js +6 -6
- package/dist/shared/deadLinks.js.map +1 -1
- package/dist/shared/escapeHtml.js +4 -4
- package/dist/shared/escapeHtml.js.map +1 -1
- package/dist/shared/index.d.ts +14 -14
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +14 -14
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/locale.d.ts +1 -1
- package/dist/shared/locale.d.ts.map +1 -1
- package/dist/shared/locale.js +10 -10
- package/dist/shared/locale.js.map +1 -1
- package/dist/shared/pageChrome.d.ts +4 -4
- package/dist/shared/pageChrome.d.ts.map +1 -1
- package/dist/shared/pageChrome.js +21 -21
- package/dist/shared/pageChrome.js.map +1 -1
- package/dist/shared/pageHead.d.ts +1 -1
- package/dist/shared/pageHead.d.ts.map +1 -1
- package/dist/shared/pageHead.js +4 -4
- package/dist/shared/pageHead.js.map +1 -1
- package/dist/shared/pageMeta.d.ts +5 -5
- package/dist/shared/pageMeta.d.ts.map +1 -1
- package/dist/shared/pageMeta.js +15 -17
- package/dist/shared/pageMeta.js.map +1 -1
- package/dist/shared/rewrites.d.ts +1 -1
- package/dist/shared/rewrites.d.ts.map +1 -1
- package/dist/shared/rewrites.js +2 -2
- package/dist/shared/rewrites.js.map +1 -1
- package/dist/shared/route.js +5 -5
- package/dist/shared/route.js.map +1 -1
- package/dist/shared/search.d.ts +3 -3
- package/dist/shared/search.d.ts.map +1 -1
- package/dist/shared/search.js +14 -14
- package/dist/shared/search.js.map +1 -1
- package/dist/shared/sidebar.d.ts +1 -1
- package/dist/shared/sidebar.d.ts.map +1 -1
- package/dist/shared/sidebar.js +4 -4
- package/dist/shared/sidebar.js.map +1 -1
- package/dist/shared/slug.d.ts +1 -1
- package/dist/shared/slug.d.ts.map +1 -1
- package/dist/shared/slug.js +5 -5
- package/dist/shared/slug.js.map +1 -1
- package/dist/shared/socialIcons.d.ts.map +1 -1
- package/dist/shared/socialIcons.js +4 -4
- package/dist/shared/socialIcons.js.map +1 -1
- package/dist/shared/tags.js +8 -8
- package/dist/shared/tags.js.map +1 -1
- package/dist/shared/theme.d.ts +1 -1
- package/dist/shared/theme.d.ts.map +1 -1
- package/dist/shared/theme.js +16 -10
- package/dist/shared/theme.js.map +1 -1
- package/dist/shared/themeLabels.d.ts +1 -1
- package/dist/shared/themeLabels.d.ts.map +1 -1
- package/dist/shared/themeLabels.js +26 -26
- package/dist/shared/themeLabels.js.map +1 -1
- package/dist/shared/url.d.ts.map +1 -1
- package/dist/shared/url.js +3 -3
- package/dist/shared/url.js.map +1 -1
- package/package.json +33 -9
- package/src/client/app.tsx +89 -92
- package/src/client/entry-client.tsx +17 -19
- package/src/client/entry-ssr.tsx +33 -33
- package/src/client/index.ts +16 -2
- package/src/client/loadPage.ts +37 -38
- package/src/client/prefetchLinks.ts +30 -30
- package/src/client/theme-default/AlgoliaSearch.tsx +46 -46
- package/src/client/theme-default/Features.tsx +27 -21
- package/src/client/theme-default/Hero.tsx +22 -18
- package/src/client/theme-default/Layout.tsx +189 -244
- package/src/client/theme-default/Logo.tsx +30 -40
- package/src/client/theme-default/NavLinks.tsx +21 -21
- package/src/client/theme-default/SidebarNav.tsx +29 -29
- package/src/client/theme-default/SocialLinks.tsx +11 -11
- package/src/client/theme-default/ThemeToggle.tsx +2 -78
- package/src/client/theme-default/index.ts +1 -1
- package/src/client/theme-default/styles.css +30 -21
- package/src/client/theme-utils.tsx +184 -0
- package/src/client/types.ts +30 -24
- package/src/client/usePageHead.ts +128 -128
- package/src/client/useSiteSearch.ts +34 -34
- package/src/client/virtual.d.ts +76 -76
- package/src/shared/contentChunk.ts +6 -6
- package/src/shared/contentSchema.ts +52 -49
- package/src/shared/deadLinks.ts +16 -16
- package/src/shared/escapeHtml.ts +5 -5
- package/src/shared/index.ts +21 -25
- package/src/shared/locale.ts +46 -46
- package/src/shared/pageChrome.ts +123 -123
- package/src/shared/pageHead.ts +16 -16
- package/src/shared/pageMeta.ts +79 -79
- package/src/shared/rewrites.ts +14 -16
- package/src/shared/route.ts +7 -7
- package/src/shared/search.ts +52 -52
- package/src/shared/sidebar.ts +28 -28
- package/src/shared/slug.ts +13 -13
- package/src/shared/socialIcons.ts +12 -14
- package/src/shared/tags.ts +20 -20
- package/src/shared/theme.ts +22 -13
- package/src/shared/themeLabels.ts +45 -45
- package/src/shared/url.ts +6 -10
- package/templates/default/.preactpress/config.ts +17 -17
- package/templates/default/README.md +16 -16
- package/templates/default/guide/first-five-minutes.md +21 -21
- package/templates/default/index.html +1 -1
- package/templates/default/index.md +9 -9
- package/templates/default/package.json +1 -1
- package/templates/default/pnpm-lock.yaml +5 -5
- package/templates/docs/.preactpress/config.ts +76 -56
- package/templates/docs/README.md +6 -6
- package/templates/docs/components/BenefitsGrid.tsx +45 -0
- package/templates/docs/components/CliBlock.tsx +38 -0
- package/templates/docs/components/ComparisonTable.tsx +60 -0
- package/templates/docs/components/CopyableCommand.tsx +86 -0
- package/templates/docs/components/Counter.tsx +7 -5
- package/templates/docs/components/MarketingHero.tsx +63 -0
- package/templates/docs/components/MdxDemo.tsx +96 -0
- package/templates/docs/components/References.tsx +62 -0
- package/templates/docs/components/TemplateGallery.tsx +46 -0
- package/templates/docs/components/marketing.css +992 -0
- package/templates/docs/examples/algolia-docsearch.md +33 -0
- package/templates/docs/examples/content-loader.data.ts +11 -0
- package/templates/docs/examples/content-loader.md +29 -0
- package/templates/docs/examples/dynamic-routes.md +16 -0
- package/templates/docs/examples/static-assets.md +13 -0
- package/templates/docs/guide/advanced.md +4 -4
- package/templates/docs/guide/commands.md +10 -10
- package/templates/docs/guide/configuration.md +43 -43
- package/templates/docs/guide/creating-pages.md +60 -39
- package/templates/docs/guide/custom-themes.md +9 -9
- package/templates/docs/guide/deploy.md +29 -29
- package/templates/docs/guide/first-five-minutes.md +22 -22
- package/templates/docs/guide/getting-started.md +29 -31
- package/templates/docs/guide/markdown-and-mdx.md +1 -1
- package/templates/docs/guide/routing.md +40 -40
- package/templates/docs/guide/what-is-preactpress.md +18 -18
- package/templates/docs/index.html +1 -1
- package/templates/docs/index.mdx +25 -0
- package/templates/docs/interactive.mdx +1 -1
- package/templates/docs/markdown-examples.md +73 -21
- package/templates/docs/package.json +1 -1
- package/templates/docs/packages/[pkg].md +15 -0
- package/templates/docs/packages/[pkg].paths.ts +20 -0
- package/templates/docs/parts/include-body.md +1 -0
- package/templates/docs/pnpm-lock.yaml +5 -5
- package/templates/docs/public/preactpress-example.txt +1 -0
- package/templates/docs/snippets/greet.ts +1 -1
- package/templates/hono/.preactpress/config.ts +65 -65
- package/templates/hono/.preactpress/theme/CodeSnippet.tsx +15 -15
- package/templates/hono/.preactpress/theme/FeatureGrid.tsx +7 -7
- package/templates/hono/.preactpress/theme/Hero.tsx +13 -13
- package/templates/hono/.preactpress/theme/Layout.tsx +122 -164
- package/templates/hono/.preactpress/theme/Logo.tsx +6 -6
- package/templates/hono/.preactpress/theme/ThemeToggle.tsx +3 -70
- package/templates/hono/.preactpress/theme/hono.css +31 -14
- package/templates/hono/README.md +17 -15
- package/templates/hono/components/Counter.tsx +7 -5
- package/templates/hono/de/guide/configuration.md +18 -20
- package/templates/hono/de/guide/deploy.md +29 -29
- package/templates/hono/de/guide/first-five-minutes.md +21 -21
- package/templates/hono/de/guide/getting-started.md +29 -29
- package/templates/hono/de/guide/routing.md +26 -25
- package/templates/hono/de/guide/seiten-erstellen.md +39 -39
- package/templates/hono/de/guide/what-is-preactpress.md +18 -18
- package/templates/hono/de/index.mdx +20 -17
- package/templates/hono/de/interactive.mdx +1 -1
- package/templates/hono/de/markdown-examples.md +6 -6
- package/templates/hono/de/parts/include-body.md +1 -0
- package/templates/hono/de/snippets/greet.ts +1 -1
- package/templates/hono/guide/configuration.md +25 -25
- package/templates/hono/guide/creating-pages.md +39 -39
- package/templates/hono/guide/deploy.md +29 -29
- package/templates/hono/guide/first-five-minutes.md +21 -21
- package/templates/hono/guide/getting-started.md +29 -29
- package/templates/hono/guide/routing.md +40 -40
- package/templates/hono/guide/what-is-preactpress.md +18 -18
- package/templates/hono/index.html +1 -1
- package/templates/hono/index.mdx +21 -17
- package/templates/hono/interactive.mdx +1 -1
- package/templates/hono/markdown-examples.md +6 -6
- package/templates/hono/package.json +1 -1
- package/templates/hono/parts/include-body.md +1 -0
- package/templates/hono/pnpm-lock.yaml +5 -5
- package/templates/hono/snippets/greet.ts +1 -1
- package/templates/magazine/.preactpress/config.ts +19 -19
- package/templates/magazine/.preactpress/theme/Layout.tsx +69 -172
- package/templates/magazine/.preactpress/theme/TeaserGrid.tsx +14 -14
- package/templates/magazine/.preactpress/theme/ThemeToggle.tsx +4 -70
- package/templates/magazine/.preactpress/theme/magazine.css +13 -8
- package/templates/magazine/README.md +30 -0
- package/templates/magazine/article-markets.md +2 -2
- package/templates/magazine/article-tech.mdx +10 -10
- package/templates/magazine/index.data.ts +9 -9
- package/templates/magazine/index.html +5 -1
- package/templates/magazine/index.mdx +1 -1
- package/templates/magazine/package.json +1 -1
- package/templates/magazine/pnpm-lock.yaml +2917 -0
- package/templates/docs/about.md +0 -10
- package/templates/docs/dist/404.html +0 -29
- package/templates/docs/dist/about/index.html +0 -32
- package/templates/docs/dist/assets/esm-DzlBxN5p.js +0 -110
- package/templates/docs/dist/assets/interactive-64o6YwrR.js +0 -9
- package/templates/docs/dist/assets/interactive-BedCloEw.js +0 -9
- package/templates/docs/dist/assets/main-BVLeh8GO.js +0 -1
- package/templates/docs/dist/assets/main-CreUBb3N.js +0 -1
- package/templates/docs/dist/assets/main-oodK-zZy.css +0 -2
- package/templates/docs/dist/de/guide/getting-started/index.html +0 -36
- package/templates/docs/dist/de/guide/what-is-preactpress/index.html +0 -38
- package/templates/docs/dist/de/index.html +0 -29
- package/templates/docs/dist/favicon-32.png +0 -0
- package/templates/docs/dist/favicon.png +0 -0
- package/templates/docs/dist/favicon.svg +0 -28
- package/templates/docs/dist/guide/advanced/index.html +0 -53
- package/templates/docs/dist/guide/commands/index.html +0 -89
- package/templates/docs/dist/guide/configuration/index.html +0 -196
- package/templates/docs/dist/guide/creating-pages/index.html +0 -234
- package/templates/docs/dist/guide/custom-themes/index.html +0 -52
- package/templates/docs/dist/guide/default-theme/index.html +0 -53
- package/templates/docs/dist/guide/deploy/index.html +0 -195
- package/templates/docs/dist/guide/first-five-minutes/index.html +0 -99
- package/templates/docs/dist/guide/getting-started/index.html +0 -173
- package/templates/docs/dist/guide/markdown-and-mdx/index.html +0 -59
- package/templates/docs/dist/guide/routing/index.html +0 -192
- package/templates/docs/dist/guide/what-is-preactpress/index.html +0 -141
- package/templates/docs/dist/index.html +0 -30
- package/templates/docs/dist/interactive/index.html +0 -37
- package/templates/docs/dist/markdown-examples/index.html +0 -231
- package/templates/docs/dist/preactpress-content/404.json +0 -8
- package/templates/docs/dist/preactpress-content/_index.json +0 -50
- package/templates/docs/dist/preactpress-content/about.json +0 -15
- package/templates/docs/dist/preactpress-content/de.json +0 -45
- package/templates/docs/dist/preactpress-content/de__guide__getting-started.json +0 -26
- package/templates/docs/dist/preactpress-content/de__guide__what-is-preactpress.json +0 -21
- package/templates/docs/dist/preactpress-content/guide__advanced.json +0 -46
- package/templates/docs/dist/preactpress-content/guide__commands.json +0 -26
- package/templates/docs/dist/preactpress-content/guide__configuration.json +0 -51
- package/templates/docs/dist/preactpress-content/guide__creating-pages.json +0 -71
- package/templates/docs/dist/preactpress-content/guide__custom-themes.json +0 -15
- package/templates/docs/dist/preactpress-content/guide__default-theme.json +0 -36
- package/templates/docs/dist/preactpress-content/guide__deploy.json +0 -56
- package/templates/docs/dist/preactpress-content/guide__first-five-minutes.json +0 -36
- package/templates/docs/dist/preactpress-content/guide__getting-started.json +0 -51
- package/templates/docs/dist/preactpress-content/guide__markdown-and-mdx.json +0 -31
- package/templates/docs/dist/preactpress-content/guide__routing.json +0 -71
- package/templates/docs/dist/preactpress-content/guide__what-is-preactpress.json +0 -51
- package/templates/docs/dist/preactpress-content/markdown-examples.json +0 -71
- package/templates/docs/dist/preactpress-content/tags__markdown.json +0 -16
- package/templates/docs/dist/preactpress-search.json +0 -166
- package/templates/docs/dist/preactpress-theme.js +0 -1
- package/templates/docs/dist/tags/markdown/index.html +0 -32
- package/templates/docs/index.md +0 -28
- package/templates/hono/dist/404.html +0 -29
- package/templates/hono/dist/README/index.html +0 -104
- package/templates/hono/dist/about/index.html +0 -32
- package/templates/hono/dist/assets/Counter-CCEByS-J.js +0 -1
- package/templates/hono/dist/assets/Hero--o6WMNvm.js +0 -2
- package/templates/hono/dist/assets/de-D5r6Ye70.js +0 -10
- package/templates/hono/dist/assets/hono-BXWYYdyv.js +0 -10
- package/templates/hono/dist/assets/interactive-Bxo-WBpC.js +0 -9
- package/templates/hono/dist/assets/interactive-BznI4IQ3.js +0 -9
- package/templates/hono/dist/assets/main-Bqi-VFEk.js +0 -2
- package/templates/hono/dist/assets/main-DIIN7FO0.css +0 -1
- package/templates/hono/dist/de/about/index.html +0 -32
- package/templates/hono/dist/de/guide/commands/index.html +0 -41
- package/templates/hono/dist/de/guide/configuration/index.html +0 -105
- package/templates/hono/dist/de/guide/deploy/index.html +0 -195
- package/templates/hono/dist/de/guide/first-five-minutes/index.html +0 -99
- package/templates/hono/dist/de/guide/getting-started/index.html +0 -173
- package/templates/hono/dist/de/guide/routing/index.html +0 -165
- package/templates/hono/dist/de/guide/seiten-erstellen/index.html +0 -234
- package/templates/hono/dist/de/guide/what-is-preactpress/index.html +0 -141
- package/templates/hono/dist/de/index.html +0 -30
- package/templates/hono/dist/de/interactive/index.html +0 -37
- package/templates/hono/dist/de/markdown-examples/index.html +0 -97
- package/templates/hono/dist/de/parts/include-body/index.html +0 -36
- package/templates/hono/dist/de/tags/markdown/index.html +0 -32
- package/templates/hono/dist/favicon-32.png +0 -0
- package/templates/hono/dist/favicon.png +0 -0
- package/templates/hono/dist/favicon.svg +0 -28
- package/templates/hono/dist/guide/commands/index.html +0 -41
- package/templates/hono/dist/guide/configuration/index.html +0 -158
- package/templates/hono/dist/guide/creating-pages/index.html +0 -234
- package/templates/hono/dist/guide/deploy/index.html +0 -195
- package/templates/hono/dist/guide/first-five-minutes/index.html +0 -99
- package/templates/hono/dist/guide/getting-started/index.html +0 -173
- package/templates/hono/dist/guide/routing/index.html +0 -165
- package/templates/hono/dist/guide/what-is-preactpress/index.html +0 -141
- package/templates/hono/dist/index.html +0 -30
- package/templates/hono/dist/interactive/index.html +0 -37
- package/templates/hono/dist/markdown-examples/index.html +0 -105
- package/templates/hono/dist/partials/shared-note/index.html +0 -30
- package/templates/hono/dist/parts/include-body/index.html +0 -36
- package/templates/hono/dist/preactpress-content/404.json +0 -8
- package/templates/hono/dist/preactpress-content/README.json +0 -26
- package/templates/hono/dist/preactpress-content/about.json +0 -15
- package/templates/hono/dist/preactpress-content/de__about.json +0 -15
- package/templates/hono/dist/preactpress-content/de__guide__commands.json +0 -36
- package/templates/hono/dist/preactpress-content/de__guide__configuration.json +0 -41
- package/templates/hono/dist/preactpress-content/de__guide__deploy.json +0 -56
- package/templates/hono/dist/preactpress-content/de__guide__first-five-minutes.json +0 -36
- package/templates/hono/dist/preactpress-content/de__guide__getting-started.json +0 -51
- package/templates/hono/dist/preactpress-content/de__guide__routing.json +0 -61
- package/templates/hono/dist/preactpress-content/de__guide__seiten-erstellen.json +0 -71
- package/templates/hono/dist/preactpress-content/de__guide__what-is-preactpress.json +0 -51
- package/templates/hono/dist/preactpress-content/de__markdown-examples.json +0 -131
- package/templates/hono/dist/preactpress-content/de__parts__include-body.json +0 -16
- package/templates/hono/dist/preactpress-content/de__tags__markdown.json +0 -16
- package/templates/hono/dist/preactpress-content/guide__commands.json +0 -36
- package/templates/hono/dist/preactpress-content/guide__configuration.json +0 -51
- package/templates/hono/dist/preactpress-content/guide__creating-pages.json +0 -71
- package/templates/hono/dist/preactpress-content/guide__deploy.json +0 -56
- package/templates/hono/dist/preactpress-content/guide__first-five-minutes.json +0 -36
- package/templates/hono/dist/preactpress-content/guide__getting-started.json +0 -51
- package/templates/hono/dist/preactpress-content/guide__routing.json +0 -61
- package/templates/hono/dist/preactpress-content/guide__what-is-preactpress.json +0 -51
- package/templates/hono/dist/preactpress-content/markdown-examples.json +0 -141
- package/templates/hono/dist/preactpress-content/partials__shared-note.json +0 -10
- package/templates/hono/dist/preactpress-content/parts__include-body.json +0 -16
- package/templates/hono/dist/preactpress-content/tags__markdown.json +0 -16
- package/templates/hono/dist/preactpress-search.json +0 -242
- package/templates/hono/dist/preactpress-theme.js +0 -1
- package/templates/hono/dist/tags/markdown/index.html +0 -32
|
@@ -1,178 +1,75 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { useEffect, useMemo, useState } from
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
url?: string
|
|
16
|
-
}
|
|
17
|
-
themeConfig: {
|
|
18
|
-
nav?: { text: string; link: string }[]
|
|
19
|
-
sidebar?: { text?: string; items: { text: string; link: string }[] }[]
|
|
20
|
-
outline?: boolean
|
|
21
|
-
search?: boolean
|
|
22
|
-
tags?: boolean
|
|
23
|
-
footer?: string
|
|
24
|
-
editLink?: { pattern: string; text?: string }
|
|
25
|
-
lastUpdated?: boolean
|
|
26
|
-
}
|
|
27
|
-
routePath: string
|
|
28
|
-
page?:
|
|
29
|
-
| {
|
|
30
|
-
kind: 'markdown'
|
|
31
|
-
title?: string
|
|
32
|
-
description?: string
|
|
33
|
-
tags?: string[]
|
|
34
|
-
meta: Record<string, unknown>
|
|
35
|
-
headings: { id: string; text: string; level: number }[]
|
|
36
|
-
relativePath?: string
|
|
37
|
-
lastUpdated?: string
|
|
38
|
-
html: string
|
|
39
|
-
}
|
|
40
|
-
| {
|
|
41
|
-
kind: 'mdx'
|
|
42
|
-
title?: string
|
|
43
|
-
description?: string
|
|
44
|
-
tags?: string[]
|
|
45
|
-
meta: Record<string, unknown>
|
|
46
|
-
headings: { id: string; text: string; level: number }[]
|
|
47
|
-
relativePath?: string
|
|
48
|
-
lastUpdated?: string
|
|
49
|
-
Component: ComponentType<{
|
|
50
|
-
components?: Record<string, ComponentType<Record<string, unknown>>>
|
|
51
|
-
}>
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function withBase(base: string, link: string): string {
|
|
56
|
-
if (/^https?:\/\//.test(link)) return link
|
|
57
|
-
const b = base === '/' ? '' : base.replace(/\/$/, '')
|
|
58
|
-
const l = link.startsWith('/') ? link : `/${link}`
|
|
59
|
-
return `${b}${l}`
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function normalizeLink(link: string): string {
|
|
63
|
-
const clean = link.split(/[?#]/, 1)[0] || '/'
|
|
64
|
-
const prefixed = clean.startsWith('/') ? clean : `/${clean}`
|
|
65
|
-
return prefixed.replace(/\/$/, '') || '/'
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function isActive(routePath: string, link: string): boolean {
|
|
69
|
-
const route = normalizeLink(routePath)
|
|
70
|
-
const target = normalizeLink(link)
|
|
71
|
-
return route === target || (target !== '/' && route.startsWith(`${target}/`))
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function childText(children: ComponentChildren): string {
|
|
75
|
-
if (children == null || typeof children === 'boolean') return ''
|
|
76
|
-
if (typeof children === 'string' || typeof children === 'number') return String(children)
|
|
77
|
-
if (Array.isArray(children)) return children.map(childText).join('')
|
|
78
|
-
if (typeof children === 'object' && 'props' in children) {
|
|
79
|
-
return childText(children.props.children as ComponentChildren)
|
|
80
|
-
}
|
|
81
|
-
return ''
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function slugify(text: string): string {
|
|
85
|
-
const slug = text
|
|
86
|
-
.toLowerCase()
|
|
87
|
-
.trim()
|
|
88
|
-
.replace(/<[^>]+>/g, '')
|
|
89
|
-
.replace(/&[a-z0-9#]+;/gi, '')
|
|
90
|
-
.replace(/[^a-z0-9]+/g, '-')
|
|
91
|
-
.replace(/^-+|-+$/g, '')
|
|
92
|
-
return slug || 'section'
|
|
93
|
-
}
|
|
1
|
+
import type { FunctionalComponent } from "preact";
|
|
2
|
+
import { useEffect, useMemo, useState } from "preact/hooks";
|
|
3
|
+
import {
|
|
4
|
+
createMdxHeadingComponents,
|
|
5
|
+
isActive,
|
|
6
|
+
normalizeLink,
|
|
7
|
+
slugifyHeading,
|
|
8
|
+
withBase,
|
|
9
|
+
type LayoutProps,
|
|
10
|
+
} from "@kamod-ch/preactpress/client";
|
|
11
|
+
import type { ArticlePost } from "@kamod-ch/preactpress/shared";
|
|
12
|
+
import ThemeToggle from "./ThemeToggle.js";
|
|
13
|
+
import TeaserGrid, { articlesToTeasers } from "./TeaserGrid.js";
|
|
14
|
+
import "./magazine.css";
|
|
94
15
|
|
|
95
16
|
function tagRoute(tag: string): string {
|
|
96
|
-
return `/tags/${
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function createMdxHeadingComponents() {
|
|
100
|
-
const used = new Map<string, number>()
|
|
101
|
-
const heading =
|
|
102
|
-
(Tag: 'h2' | 'h3') =>
|
|
103
|
-
({ children, ...props }: JSX.HTMLAttributes<HTMLHeadingElement>) => {
|
|
104
|
-
const base = slugify(childText(children))
|
|
105
|
-
const count = used.get(base) ?? 0
|
|
106
|
-
used.set(base, count + 1)
|
|
107
|
-
const id = count === 0 ? base : `${base}-${count + 1}`
|
|
108
|
-
return (
|
|
109
|
-
<Tag {...props} id={id} class={`mag-heading ${props.class ?? ''}`.trim()}>
|
|
110
|
-
{children}
|
|
111
|
-
<a class="mag-heading-anchor" href={`#${id}`} aria-label="Abschnitt verlinken">
|
|
112
|
-
#
|
|
113
|
-
</a>
|
|
114
|
-
</Tag>
|
|
115
|
-
)
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return {
|
|
119
|
-
h2: heading('h2'),
|
|
120
|
-
h3: heading('h3')
|
|
121
|
-
}
|
|
17
|
+
return `/tags/${slugifyHeading(tag)}`;
|
|
122
18
|
}
|
|
123
19
|
|
|
124
20
|
const Layout: FunctionalComponent<LayoutProps> = ({ site, themeConfig, routePath, page }) => {
|
|
125
|
-
const title = page?.title ? `${page.title} | ${site.title}` : site.title
|
|
126
|
-
const [query, setQuery] = useState(
|
|
127
|
-
const sidebarItems = (themeConfig.sidebar ?? []).flatMap((group) => group.items)
|
|
128
|
-
const normalizedQuery = query.trim().toLowerCase()
|
|
21
|
+
const title = page?.title ? `${page.title} | ${site.title}` : site.title;
|
|
22
|
+
const [query, setQuery] = useState("");
|
|
23
|
+
const sidebarItems = (themeConfig.sidebar ?? []).flatMap((group) => group.items);
|
|
24
|
+
const normalizedQuery = query.trim().toLowerCase();
|
|
129
25
|
const visibleSidebar = useMemo(() => {
|
|
130
|
-
if (!normalizedQuery) return themeConfig.sidebar ?? []
|
|
26
|
+
if (!normalizedQuery) return themeConfig.sidebar ?? [];
|
|
131
27
|
return (themeConfig.sidebar ?? [])
|
|
132
28
|
.map((group) => ({
|
|
133
29
|
...group,
|
|
134
|
-
items: group.items.filter((item) => item.text.toLowerCase().includes(normalizedQuery))
|
|
30
|
+
items: group.items.filter((item) => item.text.toLowerCase().includes(normalizedQuery)),
|
|
135
31
|
}))
|
|
136
|
-
.filter((group) => group.items.length > 0)
|
|
137
|
-
}, [normalizedQuery, themeConfig.sidebar])
|
|
138
|
-
const activeIndex = sidebarItems.findIndex((item) => isActive(routePath, item.link))
|
|
139
|
-
const previous = activeIndex > 0 ? sidebarItems[activeIndex - 1] : undefined
|
|
32
|
+
.filter((group) => group.items.length > 0);
|
|
33
|
+
}, [normalizedQuery, themeConfig.sidebar]);
|
|
34
|
+
const activeIndex = sidebarItems.findIndex((item) => isActive(routePath, item.link));
|
|
35
|
+
const previous = activeIndex > 0 ? sidebarItems[activeIndex - 1] : undefined;
|
|
140
36
|
const next =
|
|
141
37
|
activeIndex >= 0 && activeIndex < sidebarItems.length - 1
|
|
142
38
|
? sidebarItems[activeIndex + 1]
|
|
143
|
-
: undefined
|
|
144
|
-
const MdxComponent = page?.kind ===
|
|
145
|
-
const mdxComponents = createMdxHeadingComponents(
|
|
39
|
+
: undefined;
|
|
40
|
+
const MdxComponent = page?.kind === "mdx" ? page.Component : undefined;
|
|
41
|
+
const mdxComponents = createMdxHeadingComponents({
|
|
42
|
+
headingClass: "mag-heading",
|
|
43
|
+
anchorClass: "mag-heading-anchor",
|
|
44
|
+
anchorLabel: "Abschnitt verlinken",
|
|
45
|
+
});
|
|
146
46
|
const editHref =
|
|
147
47
|
themeConfig.editLink && page?.relativePath
|
|
148
48
|
? themeConfig.editLink.pattern.replace(/:path/g, page.relativePath)
|
|
149
|
-
: undefined
|
|
49
|
+
: undefined;
|
|
150
50
|
const lastUpdated = page?.lastUpdated
|
|
151
|
-
? new Date(page.lastUpdated).toLocaleDateString(site.lang ||
|
|
152
|
-
year:
|
|
153
|
-
month:
|
|
154
|
-
day:
|
|
51
|
+
? new Date(page.lastUpdated).toLocaleDateString(site.lang || "de", {
|
|
52
|
+
year: "numeric",
|
|
53
|
+
month: "short",
|
|
54
|
+
day: "numeric",
|
|
155
55
|
})
|
|
156
|
-
: undefined
|
|
157
|
-
const hasRail = (themeConfig.sidebar?.length ?? 0) > 0
|
|
158
|
-
const isHome = normalizeLink(routePath) ===
|
|
159
|
-
const homeArticles = isHome
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
month: 'long',
|
|
170
|
-
year: 'numeric'
|
|
171
|
-
}).format(new Date())
|
|
56
|
+
: undefined;
|
|
57
|
+
const hasRail = (themeConfig.sidebar?.length ?? 0) > 0;
|
|
58
|
+
const isHome = normalizeLink(routePath) === "/";
|
|
59
|
+
const homeArticles = isHome ? (page?.meta.contentData as ArticlePost[] | undefined) : undefined;
|
|
60
|
+
const homeTeasers = homeArticles?.length ? articlesToTeasers(homeArticles) : undefined;
|
|
61
|
+
const pageTags = page?.tags ?? [];
|
|
62
|
+
const showTags = themeConfig.tags !== false && pageTags.length > 0 && !page?.meta.tagIndex;
|
|
63
|
+
const today = new Intl.DateTimeFormat(site.lang || "de", {
|
|
64
|
+
weekday: "long",
|
|
65
|
+
day: "numeric",
|
|
66
|
+
month: "long",
|
|
67
|
+
year: "numeric",
|
|
68
|
+
}).format(new Date());
|
|
172
69
|
|
|
173
70
|
useEffect(() => {
|
|
174
|
-
setQuery(
|
|
175
|
-
}, [routePath])
|
|
71
|
+
setQuery("");
|
|
72
|
+
}, [routePath]);
|
|
176
73
|
|
|
177
74
|
return (
|
|
178
75
|
<div class="mag-layout">
|
|
@@ -187,7 +84,7 @@ const Layout: FunctionalComponent<LayoutProps> = ({ site, themeConfig, routePath
|
|
|
187
84
|
</div>
|
|
188
85
|
<header class="mag-masthead">
|
|
189
86
|
<div class="mag-masthead-inner">
|
|
190
|
-
<a class="mag-logo" href={withBase(site.base,
|
|
87
|
+
<a class="mag-logo" href={withBase(site.base, "/")}>
|
|
191
88
|
<span class="mag-logo-mark">Wochenausgabe</span>
|
|
192
89
|
<span class="mag-logo-title">{site.title}</span>
|
|
193
90
|
</a>
|
|
@@ -199,23 +96,23 @@ const Layout: FunctionalComponent<LayoutProps> = ({ site, themeConfig, routePath
|
|
|
199
96
|
<div class="mag-nav-wrap">
|
|
200
97
|
<nav class="mag-nav" aria-label="Hauptnavigation">
|
|
201
98
|
{(themeConfig.nav ?? []).map((item) => {
|
|
202
|
-
const active = isActive(routePath, item.link)
|
|
99
|
+
const active = isActive(routePath, item.link);
|
|
203
100
|
return (
|
|
204
101
|
<a
|
|
205
102
|
key={item.link}
|
|
206
|
-
class={active ?
|
|
103
|
+
class={active ? "active" : ""}
|
|
207
104
|
href={withBase(site.base, item.link)}
|
|
208
|
-
aria-current={active ?
|
|
105
|
+
aria-current={active ? "page" : undefined}
|
|
209
106
|
>
|
|
210
107
|
{item.text}
|
|
211
108
|
</a>
|
|
212
|
-
)
|
|
109
|
+
);
|
|
213
110
|
})}
|
|
214
111
|
</nav>
|
|
215
112
|
</div>
|
|
216
|
-
<div class={`mag-shell${hasRail ?
|
|
113
|
+
<div class={`mag-shell${hasRail ? " has-rail" : ""}`}>
|
|
217
114
|
<main id="content" class="mag-main">
|
|
218
|
-
<article class={`mag-article${isHome ?
|
|
115
|
+
<article class={`mag-article${isHome ? " wide" : ""}`}>
|
|
219
116
|
{isHome ? <p class="mag-eyebrow">Schwerpunkte</p> : null}
|
|
220
117
|
<h1 class="mag-doc-title">{page?.title ?? title}</h1>
|
|
221
118
|
{page?.description ? <p class="mag-doc-lead">{page.description}</p> : null}
|
|
@@ -236,7 +133,7 @@ const Layout: FunctionalComponent<LayoutProps> = ({ site, themeConfig, routePath
|
|
|
236
133
|
) : (
|
|
237
134
|
<div
|
|
238
135
|
class="mag-doc-content"
|
|
239
|
-
dangerouslySetInnerHTML={{ __html: page?.kind ===
|
|
136
|
+
dangerouslySetInnerHTML={{ __html: page?.kind === "markdown" ? page.html : "" }}
|
|
240
137
|
/>
|
|
241
138
|
)}
|
|
242
139
|
{previous || next ? (
|
|
@@ -262,8 +159,8 @@ const Layout: FunctionalComponent<LayoutProps> = ({ site, themeConfig, routePath
|
|
|
262
159
|
{themeConfig.lastUpdated && lastUpdated ? <span>Stand: {lastUpdated}</span> : null}
|
|
263
160
|
{editHref ? (
|
|
264
161
|
<span>
|
|
265
|
-
{themeConfig.lastUpdated && lastUpdated ?
|
|
266
|
-
<a href={editHref}>{themeConfig.editLink?.text ??
|
|
162
|
+
{themeConfig.lastUpdated && lastUpdated ? " · " : null}
|
|
163
|
+
<a href={editHref}>{themeConfig.editLink?.text ?? "Seite bearbeiten"}</a>
|
|
267
164
|
</span>
|
|
268
165
|
) : null}
|
|
269
166
|
</footer>
|
|
@@ -291,18 +188,18 @@ const Layout: FunctionalComponent<LayoutProps> = ({ site, themeConfig, routePath
|
|
|
291
188
|
{group.text ? <h2>{group.text}</h2> : null}
|
|
292
189
|
<ul>
|
|
293
190
|
{group.items.map((it) => {
|
|
294
|
-
const active = isActive(routePath, it.link)
|
|
191
|
+
const active = isActive(routePath, it.link);
|
|
295
192
|
return (
|
|
296
193
|
<li key={it.link}>
|
|
297
194
|
<a
|
|
298
|
-
class={active ?
|
|
195
|
+
class={active ? "active" : ""}
|
|
299
196
|
href={withBase(site.base, it.link)}
|
|
300
|
-
aria-current={active ?
|
|
197
|
+
aria-current={active ? "page" : undefined}
|
|
301
198
|
>
|
|
302
199
|
{it.text}
|
|
303
200
|
</a>
|
|
304
201
|
</li>
|
|
305
|
-
)
|
|
202
|
+
);
|
|
306
203
|
})}
|
|
307
204
|
</ul>
|
|
308
205
|
</div>
|
|
@@ -313,7 +210,7 @@ const Layout: FunctionalComponent<LayoutProps> = ({ site, themeConfig, routePath
|
|
|
313
210
|
</div>
|
|
314
211
|
{themeConfig.footer ? <footer class="mag-footer">{themeConfig.footer}</footer> : null}
|
|
315
212
|
</div>
|
|
316
|
-
)
|
|
317
|
-
}
|
|
213
|
+
);
|
|
214
|
+
};
|
|
318
215
|
|
|
319
|
-
export default Layout
|
|
216
|
+
export default Layout;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import type { FunctionalComponent } from
|
|
2
|
-
import type { ArticlePost } from
|
|
1
|
+
import type { FunctionalComponent } from "preact";
|
|
2
|
+
import type { ArticlePost } from "@kamod-ch/preactpress/shared";
|
|
3
3
|
|
|
4
4
|
export interface TeaserItem {
|
|
5
|
-
href: string
|
|
6
|
-
kicker: string
|
|
7
|
-
title: string
|
|
8
|
-
dek: string
|
|
9
|
-
readTime?: string
|
|
5
|
+
href: string;
|
|
6
|
+
kicker: string;
|
|
7
|
+
title: string;
|
|
8
|
+
dek: string;
|
|
9
|
+
readTime?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export interface TeaserGridProps {
|
|
13
|
-
items: TeaserItem[]
|
|
13
|
+
items: TeaserItem[];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function articlesToTeasers(posts: ArticlePost[]): TeaserItem[] {
|
|
17
17
|
return posts.map((post) => ({
|
|
18
18
|
href: post.route,
|
|
19
|
-
kicker: post.category?.name ??
|
|
19
|
+
kicker: post.category?.name ?? "Artikel",
|
|
20
20
|
title: post.title,
|
|
21
|
-
dek: post.description ??
|
|
22
|
-
readTime: post.readTime
|
|
23
|
-
}))
|
|
21
|
+
dek: post.description ?? "",
|
|
22
|
+
readTime: post.readTime,
|
|
23
|
+
}));
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const TeaserGrid: FunctionalComponent<TeaserGridProps> = ({ items }) => (
|
|
@@ -34,6 +34,6 @@ const TeaserGrid: FunctionalComponent<TeaserGridProps> = ({ items }) => (
|
|
|
34
34
|
</a>
|
|
35
35
|
))}
|
|
36
36
|
</div>
|
|
37
|
-
)
|
|
37
|
+
);
|
|
38
38
|
|
|
39
|
-
export default TeaserGrid
|
|
39
|
+
export default TeaserGrid;
|
|
@@ -1,73 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useEffect } from 'preact/hooks'
|
|
3
|
-
|
|
4
|
-
const STORAGE_KEY = 'preactpress-theme' as const
|
|
5
|
-
|
|
6
|
-
type Stored = 'light' | 'dark'
|
|
7
|
-
|
|
8
|
-
function readStored(): Stored | null {
|
|
9
|
-
if (typeof localStorage === 'undefined') return null
|
|
10
|
-
try {
|
|
11
|
-
const v = localStorage.getItem(STORAGE_KEY)
|
|
12
|
-
return v === 'light' || v === 'dark' ? v : null
|
|
13
|
-
} catch {
|
|
14
|
-
return null
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function apply(theme: Stored | null): void {
|
|
19
|
-
if (typeof document === 'undefined') return
|
|
20
|
-
const root = document.documentElement
|
|
21
|
-
if (theme === null) root.removeAttribute('data-theme')
|
|
22
|
-
else root.setAttribute('data-theme', theme)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function toggle(): void {
|
|
26
|
-
const stored = readStored()
|
|
27
|
-
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
28
|
-
const isDark = stored === 'dark' || (stored === null && prefersDark)
|
|
29
|
-
const next: Stored = isDark ? 'light' : 'dark'
|
|
30
|
-
apply(next)
|
|
31
|
-
try {
|
|
32
|
-
localStorage.setItem(STORAGE_KEY, next)
|
|
33
|
-
} catch {
|
|
34
|
-
/* ignore */
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const ThemeToggle: FunctionalComponent = () => {
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
function onStorage(e: StorageEvent): void {
|
|
41
|
-
if (e.key !== STORAGE_KEY) return
|
|
42
|
-
const v = e.newValue
|
|
43
|
-
apply(v === 'light' || v === 'dark' ? v : null)
|
|
44
|
-
}
|
|
45
|
-
window.addEventListener('storage', onStorage)
|
|
46
|
-
return () => window.removeEventListener('storage', onStorage)
|
|
47
|
-
}, [])
|
|
1
|
+
import { ThemeToggle as BaseThemeToggle } from "@kamod-ch/preactpress/client";
|
|
48
2
|
|
|
3
|
+
export default function ThemeToggle() {
|
|
49
4
|
return (
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24">
|
|
53
|
-
<path
|
|
54
|
-
strokeLinecap="round"
|
|
55
|
-
strokeLinejoin="round"
|
|
56
|
-
d="M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"
|
|
57
|
-
/>
|
|
58
|
-
</svg>
|
|
59
|
-
</span>
|
|
60
|
-
<span class="mag-theme-toggle-sun" aria-hidden="true">
|
|
61
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24">
|
|
62
|
-
<path
|
|
63
|
-
strokeLinecap="round"
|
|
64
|
-
strokeLinejoin="round"
|
|
65
|
-
d="M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"
|
|
66
|
-
/>
|
|
67
|
-
</svg>
|
|
68
|
-
</span>
|
|
69
|
-
</button>
|
|
70
|
-
)
|
|
5
|
+
<BaseThemeToggle className="mag-theme-toggle" ariaLabel="Hell- und Dunkelmodus wechseln" />
|
|
6
|
+
);
|
|
71
7
|
}
|
|
72
|
-
|
|
73
|
-
export default ThemeToggle
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
--mag-shadow: 0 12px 40px rgba(20, 16, 12, 0.08);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
[data-theme=
|
|
14
|
+
[data-theme="dark"] {
|
|
15
15
|
--mag-ink: #ece8e1;
|
|
16
16
|
--mag-paper: #121110;
|
|
17
17
|
--mag-muted: #a39e96;
|
|
@@ -36,7 +36,7 @@ html {
|
|
|
36
36
|
|
|
37
37
|
body {
|
|
38
38
|
margin: 0;
|
|
39
|
-
font-family:
|
|
39
|
+
font-family: "Newsreader", "Georgia", "Times New Roman", serif;
|
|
40
40
|
font-size: 1.05rem;
|
|
41
41
|
line-height: 1.55;
|
|
42
42
|
background: var(--mag-paper);
|
|
@@ -68,7 +68,10 @@ body {
|
|
|
68
68
|
.mag-topbar {
|
|
69
69
|
background: var(--mag-top);
|
|
70
70
|
color: var(--mag-top-fg);
|
|
71
|
-
font-family:
|
|
71
|
+
font-family:
|
|
72
|
+
system-ui,
|
|
73
|
+
-apple-system,
|
|
74
|
+
sans-serif;
|
|
72
75
|
font-size: 0.78rem;
|
|
73
76
|
letter-spacing: 0.02em;
|
|
74
77
|
}
|
|
@@ -115,7 +118,7 @@ body {
|
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
.mag-logo-title {
|
|
118
|
-
font-family:
|
|
121
|
+
font-family: "Newsreader", Georgia, serif;
|
|
119
122
|
font-weight: 700;
|
|
120
123
|
font-size: clamp(1.85rem, 4vw, 2.75rem);
|
|
121
124
|
line-height: 1.05;
|
|
@@ -354,7 +357,7 @@ body {
|
|
|
354
357
|
}
|
|
355
358
|
|
|
356
359
|
.mag-doc-content code {
|
|
357
|
-
font-family:
|
|
360
|
+
font-family: "JetBrains Mono", ui-monospace, monospace;
|
|
358
361
|
font-size: 0.9em;
|
|
359
362
|
}
|
|
360
363
|
|
|
@@ -502,7 +505,9 @@ body {
|
|
|
502
505
|
text-decoration: none;
|
|
503
506
|
color: inherit;
|
|
504
507
|
box-shadow: var(--mag-shadow);
|
|
505
|
-
transition:
|
|
508
|
+
transition:
|
|
509
|
+
border-color 0.15s ease,
|
|
510
|
+
transform 0.15s ease;
|
|
506
511
|
}
|
|
507
512
|
|
|
508
513
|
.mag-teaser-card:hover {
|
|
@@ -578,10 +583,10 @@ body {
|
|
|
578
583
|
}
|
|
579
584
|
}
|
|
580
585
|
|
|
581
|
-
:root[data-theme=
|
|
586
|
+
:root[data-theme="light"] .mag-theme-toggle .mag-theme-toggle-moon {
|
|
582
587
|
display: inline-flex;
|
|
583
588
|
}
|
|
584
589
|
|
|
585
|
-
:root[data-theme=
|
|
590
|
+
:root[data-theme="dark"] .mag-theme-toggle .mag-theme-toggle-sun {
|
|
586
591
|
display: inline-flex;
|
|
587
592
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# PreactPress Magazine Starter
|
|
2
|
+
|
|
3
|
+
An editorial starter for PreactPress with a custom magazine theme, article teasers, tags, and a content-loader driven home page.
|
|
4
|
+
|
|
5
|
+
## Getting started
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm install
|
|
9
|
+
pnpm dev
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Open [http://localhost:5173](http://localhost:5173).
|
|
13
|
+
|
|
14
|
+
## Scripts
|
|
15
|
+
|
|
16
|
+
| Command | Purpose |
|
|
17
|
+
| -------------- | ---------------------------- |
|
|
18
|
+
| `pnpm dev` | Start the development server |
|
|
19
|
+
| `pnpm check` | Validate routes and links |
|
|
20
|
+
| `pnpm build` | Generate static output |
|
|
21
|
+
| `pnpm preview` | Preview the static build |
|
|
22
|
+
|
|
23
|
+
## What to edit
|
|
24
|
+
|
|
25
|
+
- `.preactpress/config.ts` configures the site title, theme, sidebar, and footer.
|
|
26
|
+
- `.preactpress/theme/` contains the custom magazine layout and styles.
|
|
27
|
+
- `index.data.ts` loads article frontmatter for the home page teaser grid.
|
|
28
|
+
- `article-*.md(x)` files are example articles.
|
|
29
|
+
|
|
30
|
+
Set `site.url` and `site.base` in `.preactpress/config.ts` before deploying to a production host.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Handel und Margen im Frühjahr
|
|
3
|
-
description:
|
|
3
|
+
description: "Zwischen Volumen und Warenwert: wie Händlerinnen und Händler ihre KPI-Sets überdenken."
|
|
4
4
|
tags:
|
|
5
5
|
- Handel
|
|
6
6
|
- Margen
|
|
@@ -11,7 +11,7 @@ readTime: 6 Min.
|
|
|
11
11
|
|
|
12
12
|
## Einordnung
|
|
13
13
|
|
|
14
|
-
Die Berichtssaison liefert wieder **Mischsignale**: Während einige Segmente von Volumenrückgängen sprechen, halten sich Warenwerte in ausgewählten Kategorien stabil. Entscheidend ist weniger die reine Fläche, sondern die
|
|
14
|
+
Die Berichtssaison liefert wieder **Mischsignale**: Während einige Segmente von Volumenrückgängen sprechen, halten sich Warenwerte in ausgewählten Kategorien stabil. Entscheidend ist weniger die reine Fläche, sondern die _Rotation pro Quadratmeter_ und die **Treue** am PoS.
|
|
15
15
|
|
|
16
16
|
### Was Analysen häufig übersehen
|
|
17
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Automatisierung in der letzten Meile
|
|
3
|
-
description:
|
|
3
|
+
description: "Kleines MDX-Beispiel mit Code — passend zu Logistik- und Tech-Rubriken."
|
|
4
4
|
tags:
|
|
5
5
|
- Tech
|
|
6
6
|
- Logistik
|
|
@@ -15,21 +15,21 @@ Viele Teams beginnen mit einem schlanken **Node**-Skript, das Sendungen gruppier
|
|
|
15
15
|
|
|
16
16
|
```js
|
|
17
17
|
export function clusterByPostalCode(parcels) {
|
|
18
|
-
const map = new Map()
|
|
18
|
+
const map = new Map();
|
|
19
19
|
for (const p of parcels) {
|
|
20
|
-
const k = p.postalCode.slice(0, 2)
|
|
21
|
-
const list = map.get(k) ?? []
|
|
22
|
-
list.push(p)
|
|
23
|
-
map.set(k, list)
|
|
20
|
+
const k = p.postalCode.slice(0, 2);
|
|
21
|
+
const list = map.get(k) ?? [];
|
|
22
|
+
list.push(p);
|
|
23
|
+
map.set(k, list);
|
|
24
24
|
}
|
|
25
|
-
return map
|
|
25
|
+
return map;
|
|
26
26
|
}
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
### Nächste Schritte
|
|
30
30
|
|
|
31
|
-
1. Datenqualität an der Quelle absichern
|
|
32
|
-
2. Routing-Engine mit echten SLAs testen
|
|
33
|
-
3. Dashboards auf **Echtzeit**-Fehlerquoten trimmen
|
|
31
|
+
1. Datenqualität an der Quelle absichern
|
|
32
|
+
2. Routing-Engine mit echten SLAs testen
|
|
33
|
+
3. Dashboards auf **Echtzeit**-Fehlerquoten trimmen
|
|
34
34
|
|
|
35
35
|
Interaktive Bausteine (Zähler, Charts) kannst du wie gewohnt als **Preact-Komponenten** importieren.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createContentLoader } from
|
|
2
|
-
import { articleFromFrontmatter, type ArticlePost } from
|
|
1
|
+
import { createContentLoader } from "@kamod-ch/preactpress/config";
|
|
2
|
+
import { articleFromFrontmatter, type ArticlePost } from "@kamod-ch/preactpress/shared";
|
|
3
3
|
|
|
4
|
-
export default createContentLoader<ArticlePost[]>([
|
|
4
|
+
export default createContentLoader<ArticlePost[]>(["article-*.md", "article-*.mdx"], {
|
|
5
5
|
transform(items) {
|
|
6
6
|
return items.map((item) =>
|
|
7
7
|
articleFromFrontmatter({
|
|
@@ -10,10 +10,10 @@ export default createContentLoader<ArticlePost[]>(['article-*.md', 'article-*.md
|
|
|
10
10
|
title: item.title,
|
|
11
11
|
description: item.description,
|
|
12
12
|
tags: Array.isArray(item.frontmatter.tags)
|
|
13
|
-
? item.frontmatter.tags.filter((tag): tag is string => typeof tag ===
|
|
13
|
+
? item.frontmatter.tags.filter((tag): tag is string => typeof tag === "string")
|
|
14
14
|
: undefined,
|
|
15
|
-
frontmatter: item.frontmatter
|
|
16
|
-
})
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
})
|
|
15
|
+
frontmatter: item.frontmatter,
|
|
16
|
+
}),
|
|
17
|
+
);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -4,11 +4,15 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Magazin</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" />
|
|
7
11
|
</head>
|
|
8
12
|
<body>
|
|
9
13
|
<div id="app"></div>
|
|
10
14
|
<script type="module">
|
|
11
|
-
import
|
|
15
|
+
import "preactpress/app";
|
|
12
16
|
</script>
|
|
13
17
|
</body>
|
|
14
18
|
</html>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Startseite
|
|
3
|
-
description:
|
|
3
|
+
description: "Kommentierte Marktlage, Filialisten und ein Blick auf Tech & Logistik — alles statisch aus Markdown und MDX."
|
|
4
4
|
tags:
|
|
5
5
|
- Magazin
|
|
6
6
|
- Startseite
|