@kamod-ch/preactpress 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -49
- package/bin/preactpress.mjs +5 -5
- package/dist/client/app.d.ts +1 -1
- package/dist/client/app.d.ts.map +1 -1
- package/dist/client/app.js +55 -42
- package/dist/client/app.js.map +1 -1
- package/dist/client/entry-client.js +11 -12
- package/dist/client/entry-client.js.map +1 -1
- package/dist/client/entry-ssr.d.ts +2 -2
- package/dist/client/entry-ssr.d.ts.map +1 -1
- package/dist/client/entry-ssr.js +16 -16
- package/dist/client/entry-ssr.js.map +1 -1
- package/dist/client/index.d.ts +3 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/loadPage.d.ts +2 -1
- package/dist/client/loadPage.d.ts.map +1 -1
- package/dist/client/loadPage.js +15 -12
- package/dist/client/loadPage.js.map +1 -1
- package/dist/client/prefetchLinks.js +4 -4
- package/dist/client/prefetchLinks.js.map +1 -1
- package/dist/client/theme-default/AlgoliaSearch.d.ts +3 -3
- package/dist/client/theme-default/AlgoliaSearch.d.ts.map +1 -1
- package/dist/client/theme-default/AlgoliaSearch.js +15 -15
- package/dist/client/theme-default/AlgoliaSearch.js.map +1 -1
- package/dist/client/theme-default/Features.d.ts +2 -2
- package/dist/client/theme-default/Features.d.ts.map +1 -1
- package/dist/client/theme-default/Features.js +10 -8
- package/dist/client/theme-default/Features.js.map +1 -1
- package/dist/client/theme-default/Hero.d.ts +2 -2
- package/dist/client/theme-default/Hero.d.ts.map +1 -1
- package/dist/client/theme-default/Hero.js +9 -7
- package/dist/client/theme-default/Hero.js.map +1 -1
- package/dist/client/theme-default/Layout.d.ts +3 -3
- package/dist/client/theme-default/Layout.d.ts.map +1 -1
- package/dist/client/theme-default/Layout.js +56 -99
- package/dist/client/theme-default/Layout.js.map +1 -1
- package/dist/client/theme-default/Logo.d.ts +2 -2
- package/dist/client/theme-default/Logo.d.ts.map +1 -1
- package/dist/client/theme-default/Logo.js +8 -8
- package/dist/client/theme-default/Logo.js.map +1 -1
- package/dist/client/theme-default/NavLinks.d.ts +2 -2
- package/dist/client/theme-default/NavLinks.d.ts.map +1 -1
- package/dist/client/theme-default/NavLinks.js +3 -3
- package/dist/client/theme-default/NavLinks.js.map +1 -1
- package/dist/client/theme-default/SidebarNav.d.ts +2 -2
- package/dist/client/theme-default/SidebarNav.d.ts.map +1 -1
- package/dist/client/theme-default/SidebarNav.js +3 -3
- package/dist/client/theme-default/SidebarNav.js.map +1 -1
- package/dist/client/theme-default/SocialLinks.d.ts +2 -2
- package/dist/client/theme-default/SocialLinks.d.ts.map +1 -1
- package/dist/client/theme-default/SocialLinks.js +1 -1
- package/dist/client/theme-default/SocialLinks.js.map +1 -1
- package/dist/client/theme-default/ThemeToggle.d.ts +2 -3
- package/dist/client/theme-default/ThemeToggle.d.ts.map +1 -1
- package/dist/client/theme-default/ThemeToggle.js +2 -30
- package/dist/client/theme-default/ThemeToggle.js.map +1 -1
- package/dist/client/theme-default/index.d.ts +1 -1
- package/dist/client/theme-default/index.d.ts.map +1 -1
- package/dist/client/theme-default/index.js +1 -1
- package/dist/client/theme-default/index.js.map +1 -1
- package/dist/client/theme-utils.d.ts +24 -0
- package/dist/client/theme-utils.d.ts.map +1 -0
- package/dist/client/theme-utils.js +107 -0
- package/dist/client/theme-utils.js.map +1 -0
- package/dist/client/types.d.ts +5 -5
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/usePageHead.d.ts +2 -2
- package/dist/client/usePageHead.d.ts.map +1 -1
- package/dist/client/usePageHead.js +61 -56
- package/dist/client/usePageHead.js.map +1 -1
- package/dist/client/useSiteSearch.d.ts.map +1 -1
- package/dist/client/useSiteSearch.js +8 -8
- package/dist/client/useSiteSearch.js.map +1 -1
- package/dist/node/build.d.ts +1 -1
- package/dist/node/build.d.ts.map +1 -1
- package/dist/node/build.js +105 -96
- package/dist/node/build.js.map +1 -1
- package/dist/node/buildCache.d.ts.map +1 -1
- package/dist/node/buildCache.js +7 -7
- package/dist/node/buildCache.js.map +1 -1
- package/dist/node/check.d.ts +1 -1
- package/dist/node/check.d.ts.map +1 -1
- package/dist/node/check.js +52 -52
- package/dist/node/check.js.map +1 -1
- package/dist/node/cli.js +61 -64
- package/dist/node/cli.js.map +1 -1
- package/dist/node/config-helpers.d.ts +4 -4
- package/dist/node/config-helpers.d.ts.map +1 -1
- package/dist/node/config-helpers.js +1 -1
- package/dist/node/config-helpers.js.map +1 -1
- package/dist/node/config.d.ts +4 -4
- package/dist/node/config.d.ts.map +1 -1
- package/dist/node/config.js +37 -40
- package/dist/node/config.js.map +1 -1
- package/dist/node/content.d.ts +4 -4
- package/dist/node/content.d.ts.map +1 -1
- package/dist/node/content.js +28 -28
- package/dist/node/content.js.map +1 -1
- package/dist/node/createContentLoader.d.ts +1 -1
- package/dist/node/createContentLoader.d.ts.map +1 -1
- package/dist/node/createContentLoader.js +3 -3
- package/dist/node/createContentLoader.js.map +1 -1
- package/dist/node/devCss.d.ts +1 -1
- package/dist/node/devCss.d.ts.map +1 -1
- package/dist/node/devCss.js +5 -6
- package/dist/node/devCss.js.map +1 -1
- package/dist/node/devSsr.d.ts +3 -3
- package/dist/node/devSsr.d.ts.map +1 -1
- package/dist/node/devSsr.js +32 -32
- package/dist/node/devSsr.js.map +1 -1
- package/dist/node/dynamicRoutes.d.ts +2 -2
- package/dist/node/dynamicRoutes.d.ts.map +1 -1
- package/dist/node/dynamicRoutes.js +24 -24
- package/dist/node/dynamicRoutes.js.map +1 -1
- package/dist/node/favicon.d.ts +2 -2
- package/dist/node/favicon.d.ts.map +1 -1
- package/dist/node/favicon.js +26 -24
- package/dist/node/favicon.js.map +1 -1
- package/dist/node/feed.d.ts +2 -2
- package/dist/node/feed.d.ts.map +1 -1
- package/dist/node/feed.js +18 -16
- package/dist/node/feed.js.map +1 -1
- package/dist/node/hooks.d.ts +2 -2
- package/dist/node/hooks.d.ts.map +1 -1
- package/dist/node/hooks.js +1 -1
- package/dist/node/hooks.js.map +1 -1
- package/dist/node/html.d.ts +8 -8
- package/dist/node/html.d.ts.map +1 -1
- package/dist/node/html.js +75 -64
- package/dist/node/html.js.map +1 -1
- package/dist/node/index.d.ts +11 -11
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +8 -8
- package/dist/node/index.js.map +1 -1
- package/dist/node/init.d.ts +2 -0
- package/dist/node/init.d.ts.map +1 -1
- package/dist/node/init.js +59 -27
- package/dist/node/init.js.map +1 -1
- package/dist/node/lastUpdated.d.ts +2 -2
- package/dist/node/lastUpdated.d.ts.map +1 -1
- package/dist/node/lastUpdated.js +7 -4
- package/dist/node/lastUpdated.js.map +1 -1
- package/dist/node/loadSiteModule.js +2 -2
- package/dist/node/loadSiteModule.js.map +1 -1
- package/dist/node/markdown.d.ts +2 -2
- package/dist/node/markdown.d.ts.map +1 -1
- package/dist/node/markdown.js +110 -110
- package/dist/node/markdown.js.map +1 -1
- package/dist/node/markdownHeadings.d.ts +1 -1
- package/dist/node/markdownHeadings.d.ts.map +1 -1
- package/dist/node/markdownHeadings.js +11 -11
- package/dist/node/markdownHeadings.js.map +1 -1
- package/dist/node/markdownInclude.d.ts.map +1 -1
- package/dist/node/markdownInclude.js +11 -11
- package/dist/node/markdownInclude.js.map +1 -1
- package/dist/node/markdownSnippets.d.ts.map +1 -1
- package/dist/node/markdownSnippets.js +34 -34
- package/dist/node/markdownSnippets.js.map +1 -1
- package/dist/node/mdx.d.ts +1 -1
- package/dist/node/mdx.d.ts.map +1 -1
- package/dist/node/mdx.js +4 -4
- package/dist/node/mdx.js.map +1 -1
- package/dist/node/packageRoot.d.ts.map +1 -1
- package/dist/node/packageRoot.js +4 -4
- package/dist/node/packageRoot.js.map +1 -1
- package/dist/node/pageDataLoaders.d.ts +2 -2
- package/dist/node/pageDataLoaders.d.ts.map +1 -1
- package/dist/node/pageDataLoaders.js +24 -20
- package/dist/node/pageDataLoaders.js.map +1 -1
- package/dist/node/paths.d.ts.map +1 -1
- package/dist/node/paths.js +4 -4
- package/dist/node/paths.js.map +1 -1
- package/dist/node/plugin.d.ts +3 -3
- package/dist/node/plugin.d.ts.map +1 -1
- package/dist/node/plugin.js +66 -66
- package/dist/node/plugin.js.map +1 -1
- package/dist/node/resolveDeps.js +10 -10
- package/dist/node/resolveDeps.js.map +1 -1
- package/dist/node/serve.d.ts.map +1 -1
- package/dist/node/serve.js +13 -15
- package/dist/node/serve.js.map +1 -1
- package/dist/node/server.d.ts +3 -3
- package/dist/node/server.d.ts.map +1 -1
- package/dist/node/server.js +28 -25
- package/dist/node/server.js.map +1 -1
- package/dist/node/siteConfig.d.ts +12 -12
- package/dist/node/siteConfig.d.ts.map +1 -1
- package/dist/node/tagIndex.d.ts +5 -5
- package/dist/node/tagIndex.d.ts.map +1 -1
- package/dist/node/tagIndex.js +10 -10
- package/dist/node/tagIndex.js.map +1 -1
- package/dist/shared/contentChunk.d.ts.map +1 -1
- package/dist/shared/contentChunk.js +6 -6
- package/dist/shared/contentChunk.js.map +1 -1
- package/dist/shared/contentSchema.d.ts.map +1 -1
- package/dist/shared/contentSchema.js +11 -11
- package/dist/shared/contentSchema.js.map +1 -1
- package/dist/shared/deadLinks.d.ts.map +1 -1
- package/dist/shared/deadLinks.js +6 -6
- package/dist/shared/deadLinks.js.map +1 -1
- package/dist/shared/escapeHtml.js +4 -4
- package/dist/shared/escapeHtml.js.map +1 -1
- package/dist/shared/index.d.ts +14 -14
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +14 -14
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/locale.d.ts +1 -1
- package/dist/shared/locale.d.ts.map +1 -1
- package/dist/shared/locale.js +10 -10
- package/dist/shared/locale.js.map +1 -1
- package/dist/shared/pageChrome.d.ts +4 -4
- package/dist/shared/pageChrome.d.ts.map +1 -1
- package/dist/shared/pageChrome.js +21 -21
- package/dist/shared/pageChrome.js.map +1 -1
- package/dist/shared/pageHead.d.ts +1 -1
- package/dist/shared/pageHead.d.ts.map +1 -1
- package/dist/shared/pageHead.js +4 -4
- package/dist/shared/pageHead.js.map +1 -1
- package/dist/shared/pageMeta.d.ts +5 -5
- package/dist/shared/pageMeta.d.ts.map +1 -1
- package/dist/shared/pageMeta.js +15 -17
- package/dist/shared/pageMeta.js.map +1 -1
- package/dist/shared/rewrites.d.ts +1 -1
- package/dist/shared/rewrites.d.ts.map +1 -1
- package/dist/shared/rewrites.js +2 -2
- package/dist/shared/rewrites.js.map +1 -1
- package/dist/shared/route.js +5 -5
- package/dist/shared/route.js.map +1 -1
- package/dist/shared/scrollRestoration.d.ts +10 -0
- package/dist/shared/scrollRestoration.d.ts.map +1 -0
- package/dist/shared/scrollRestoration.js +66 -0
- package/dist/shared/scrollRestoration.js.map +1 -0
- package/dist/shared/search.d.ts +3 -3
- package/dist/shared/search.d.ts.map +1 -1
- package/dist/shared/search.js +18 -15
- package/dist/shared/search.js.map +1 -1
- package/dist/shared/sidebar.d.ts +1 -1
- package/dist/shared/sidebar.d.ts.map +1 -1
- package/dist/shared/sidebar.js +4 -4
- package/dist/shared/sidebar.js.map +1 -1
- package/dist/shared/slug.d.ts +1 -1
- package/dist/shared/slug.d.ts.map +1 -1
- package/dist/shared/slug.js +5 -5
- package/dist/shared/slug.js.map +1 -1
- package/dist/shared/socialIcons.d.ts.map +1 -1
- package/dist/shared/socialIcons.js +4 -4
- package/dist/shared/socialIcons.js.map +1 -1
- package/dist/shared/tags.js +8 -8
- package/dist/shared/tags.js.map +1 -1
- package/dist/shared/theme.d.ts +1 -1
- package/dist/shared/theme.d.ts.map +1 -1
- package/dist/shared/theme.js +16 -10
- package/dist/shared/theme.js.map +1 -1
- package/dist/shared/themeLabels.d.ts +1 -1
- package/dist/shared/themeLabels.d.ts.map +1 -1
- package/dist/shared/themeLabels.js +26 -26
- package/dist/shared/themeLabels.js.map +1 -1
- package/dist/shared/url.d.ts.map +1 -1
- package/dist/shared/url.js +3 -3
- package/dist/shared/url.js.map +1 -1
- package/package.json +33 -9
- package/src/client/app.tsx +111 -92
- package/src/client/entry-client.tsx +17 -19
- package/src/client/entry-ssr.tsx +33 -33
- package/src/client/index.ts +16 -2
- package/src/client/loadPage.ts +41 -38
- package/src/client/prefetchLinks.ts +30 -30
- package/src/client/theme-default/AlgoliaSearch.tsx +46 -46
- package/src/client/theme-default/Features.tsx +27 -21
- package/src/client/theme-default/Hero.tsx +22 -18
- package/src/client/theme-default/Layout.tsx +189 -244
- package/src/client/theme-default/Logo.tsx +30 -40
- package/src/client/theme-default/NavLinks.tsx +21 -21
- package/src/client/theme-default/SidebarNav.tsx +29 -29
- package/src/client/theme-default/SocialLinks.tsx +11 -11
- package/src/client/theme-default/ThemeToggle.tsx +2 -78
- package/src/client/theme-default/index.ts +1 -1
- package/src/client/theme-default/styles.css +30 -21
- package/src/client/theme-utils.tsx +184 -0
- package/src/client/types.ts +30 -24
- package/src/client/usePageHead.ts +128 -128
- package/src/client/useSiteSearch.ts +34 -34
- package/src/client/virtual.d.ts +76 -76
- package/src/shared/contentChunk.ts +6 -6
- package/src/shared/contentSchema.ts +52 -49
- package/src/shared/deadLinks.ts +16 -16
- package/src/shared/escapeHtml.ts +5 -5
- package/src/shared/index.ts +21 -25
- package/src/shared/locale.ts +46 -46
- package/src/shared/pageChrome.ts +123 -123
- package/src/shared/pageHead.ts +16 -16
- package/src/shared/pageMeta.ts +79 -79
- package/src/shared/rewrites.ts +14 -16
- package/src/shared/route.ts +7 -7
- package/src/shared/scrollRestoration.ts +70 -0
- package/src/shared/search.ts +56 -52
- package/src/shared/sidebar.ts +28 -28
- package/src/shared/slug.ts +13 -13
- package/src/shared/socialIcons.ts +12 -14
- package/src/shared/tags.ts +20 -20
- package/src/shared/theme.ts +22 -13
- package/src/shared/themeLabels.ts +45 -45
- package/src/shared/url.ts +6 -10
- package/templates/default/.preactpress/config.ts +17 -17
- package/templates/default/README.md +16 -16
- package/templates/default/guide/first-five-minutes.md +21 -21
- package/templates/default/index.html +1 -1
- package/templates/default/index.md +9 -9
- package/templates/default/package.json +1 -1
- package/templates/default/pnpm-lock.yaml +5 -5
- package/templates/docs/.preactpress/config.ts +76 -56
- package/templates/docs/README.md +6 -6
- package/templates/docs/components/BenefitsGrid.tsx +45 -0
- package/templates/docs/components/CliBlock.tsx +38 -0
- package/templates/docs/components/ComparisonTable.tsx +60 -0
- package/templates/docs/components/CopyableCommand.tsx +86 -0
- package/templates/docs/components/Counter.tsx +7 -5
- package/templates/docs/components/MarketingHero.tsx +63 -0
- package/templates/docs/components/MdxDemo.tsx +96 -0
- package/templates/docs/components/References.tsx +62 -0
- package/templates/docs/components/TemplateGallery.tsx +46 -0
- package/templates/docs/components/marketing.css +992 -0
- package/templates/docs/examples/algolia-docsearch.md +33 -0
- package/templates/docs/examples/content-loader.data.ts +11 -0
- package/templates/docs/examples/content-loader.md +29 -0
- package/templates/docs/examples/dynamic-routes.md +16 -0
- package/templates/docs/examples/static-assets.md +13 -0
- package/templates/docs/guide/advanced.md +4 -4
- package/templates/docs/guide/commands.md +10 -10
- package/templates/docs/guide/configuration.md +43 -43
- package/templates/docs/guide/creating-pages.md +60 -39
- package/templates/docs/guide/custom-themes.md +9 -9
- package/templates/docs/guide/deploy.md +29 -29
- package/templates/docs/guide/first-five-minutes.md +22 -22
- package/templates/docs/guide/getting-started.md +29 -31
- package/templates/docs/guide/markdown-and-mdx.md +1 -1
- package/templates/docs/guide/routing.md +40 -40
- package/templates/docs/guide/what-is-preactpress.md +18 -18
- package/templates/docs/index.html +1 -1
- package/templates/docs/index.mdx +25 -0
- package/templates/docs/interactive.mdx +1 -1
- package/templates/docs/markdown-examples.md +73 -21
- package/templates/docs/package.json +1 -1
- package/templates/docs/packages/[pkg].md +15 -0
- package/templates/docs/packages/[pkg].paths.ts +20 -0
- package/templates/docs/parts/include-body.md +1 -0
- package/templates/docs/pnpm-lock.yaml +5 -5
- package/templates/docs/public/preactpress-example.txt +1 -0
- package/templates/docs/snippets/greet.ts +1 -1
- package/templates/hono/.preactpress/config.ts +65 -65
- package/templates/hono/.preactpress/theme/CodeSnippet.tsx +15 -15
- package/templates/hono/.preactpress/theme/FeatureGrid.tsx +7 -7
- package/templates/hono/.preactpress/theme/Hero.tsx +13 -13
- package/templates/hono/.preactpress/theme/Layout.tsx +122 -164
- package/templates/hono/.preactpress/theme/Logo.tsx +6 -6
- package/templates/hono/.preactpress/theme/ThemeToggle.tsx +3 -70
- package/templates/hono/.preactpress/theme/hono.css +31 -14
- package/templates/hono/README.md +17 -15
- package/templates/hono/components/Counter.tsx +7 -5
- package/templates/hono/de/guide/configuration.md +18 -20
- package/templates/hono/de/guide/deploy.md +29 -29
- package/templates/hono/de/guide/first-five-minutes.md +21 -21
- package/templates/hono/de/guide/getting-started.md +29 -29
- package/templates/hono/de/guide/routing.md +26 -25
- package/templates/hono/de/guide/seiten-erstellen.md +39 -39
- package/templates/hono/de/guide/what-is-preactpress.md +18 -18
- package/templates/hono/de/index.mdx +20 -17
- package/templates/hono/de/interactive.mdx +1 -1
- package/templates/hono/de/markdown-examples.md +6 -6
- package/templates/hono/de/parts/include-body.md +1 -0
- package/templates/hono/de/snippets/greet.ts +1 -1
- package/templates/hono/guide/configuration.md +25 -25
- package/templates/hono/guide/creating-pages.md +39 -39
- package/templates/hono/guide/deploy.md +29 -29
- package/templates/hono/guide/first-five-minutes.md +21 -21
- package/templates/hono/guide/getting-started.md +29 -29
- package/templates/hono/guide/routing.md +40 -40
- package/templates/hono/guide/what-is-preactpress.md +18 -18
- package/templates/hono/index.html +1 -1
- package/templates/hono/index.mdx +21 -17
- package/templates/hono/interactive.mdx +1 -1
- package/templates/hono/markdown-examples.md +6 -6
- package/templates/hono/package.json +1 -1
- package/templates/hono/parts/include-body.md +1 -0
- package/templates/hono/pnpm-lock.yaml +5 -5
- package/templates/hono/snippets/greet.ts +1 -1
- package/templates/magazine/.preactpress/config.ts +19 -19
- package/templates/magazine/.preactpress/theme/Layout.tsx +69 -172
- package/templates/magazine/.preactpress/theme/TeaserGrid.tsx +14 -14
- package/templates/magazine/.preactpress/theme/ThemeToggle.tsx +4 -70
- package/templates/magazine/.preactpress/theme/magazine.css +13 -8
- package/templates/magazine/README.md +30 -0
- package/templates/magazine/article-markets.md +2 -2
- package/templates/magazine/article-tech.mdx +10 -10
- package/templates/magazine/index.data.ts +9 -9
- package/templates/magazine/index.html +5 -1
- package/templates/magazine/index.mdx +1 -1
- package/templates/magazine/package.json +1 -1
- package/templates/magazine/pnpm-lock.yaml +2917 -0
- package/templates/docs/about.md +0 -10
- package/templates/docs/dist/404.html +0 -29
- package/templates/docs/dist/about/index.html +0 -32
- package/templates/docs/dist/assets/esm-DzlBxN5p.js +0 -110
- package/templates/docs/dist/assets/interactive-64o6YwrR.js +0 -9
- package/templates/docs/dist/assets/interactive-BedCloEw.js +0 -9
- package/templates/docs/dist/assets/main-BVLeh8GO.js +0 -1
- package/templates/docs/dist/assets/main-CreUBb3N.js +0 -1
- package/templates/docs/dist/assets/main-oodK-zZy.css +0 -2
- package/templates/docs/dist/de/guide/getting-started/index.html +0 -36
- package/templates/docs/dist/de/guide/what-is-preactpress/index.html +0 -38
- package/templates/docs/dist/de/index.html +0 -29
- package/templates/docs/dist/favicon-32.png +0 -0
- package/templates/docs/dist/favicon.png +0 -0
- package/templates/docs/dist/favicon.svg +0 -28
- package/templates/docs/dist/guide/advanced/index.html +0 -53
- package/templates/docs/dist/guide/commands/index.html +0 -89
- package/templates/docs/dist/guide/configuration/index.html +0 -196
- package/templates/docs/dist/guide/creating-pages/index.html +0 -234
- package/templates/docs/dist/guide/custom-themes/index.html +0 -52
- package/templates/docs/dist/guide/default-theme/index.html +0 -53
- package/templates/docs/dist/guide/deploy/index.html +0 -195
- package/templates/docs/dist/guide/first-five-minutes/index.html +0 -99
- package/templates/docs/dist/guide/getting-started/index.html +0 -173
- package/templates/docs/dist/guide/markdown-and-mdx/index.html +0 -59
- package/templates/docs/dist/guide/routing/index.html +0 -192
- package/templates/docs/dist/guide/what-is-preactpress/index.html +0 -141
- package/templates/docs/dist/index.html +0 -30
- package/templates/docs/dist/interactive/index.html +0 -37
- package/templates/docs/dist/markdown-examples/index.html +0 -231
- package/templates/docs/dist/preactpress-content/404.json +0 -8
- package/templates/docs/dist/preactpress-content/_index.json +0 -50
- package/templates/docs/dist/preactpress-content/about.json +0 -15
- package/templates/docs/dist/preactpress-content/de.json +0 -45
- package/templates/docs/dist/preactpress-content/de__guide__getting-started.json +0 -26
- package/templates/docs/dist/preactpress-content/de__guide__what-is-preactpress.json +0 -21
- package/templates/docs/dist/preactpress-content/guide__advanced.json +0 -46
- package/templates/docs/dist/preactpress-content/guide__commands.json +0 -26
- package/templates/docs/dist/preactpress-content/guide__configuration.json +0 -51
- package/templates/docs/dist/preactpress-content/guide__creating-pages.json +0 -71
- package/templates/docs/dist/preactpress-content/guide__custom-themes.json +0 -15
- package/templates/docs/dist/preactpress-content/guide__default-theme.json +0 -36
- package/templates/docs/dist/preactpress-content/guide__deploy.json +0 -56
- package/templates/docs/dist/preactpress-content/guide__first-five-minutes.json +0 -36
- package/templates/docs/dist/preactpress-content/guide__getting-started.json +0 -51
- package/templates/docs/dist/preactpress-content/guide__markdown-and-mdx.json +0 -31
- package/templates/docs/dist/preactpress-content/guide__routing.json +0 -71
- package/templates/docs/dist/preactpress-content/guide__what-is-preactpress.json +0 -51
- package/templates/docs/dist/preactpress-content/markdown-examples.json +0 -71
- package/templates/docs/dist/preactpress-content/tags__markdown.json +0 -16
- package/templates/docs/dist/preactpress-search.json +0 -166
- package/templates/docs/dist/preactpress-theme.js +0 -1
- package/templates/docs/dist/tags/markdown/index.html +0 -32
- package/templates/docs/index.md +0 -28
- package/templates/hono/dist/404.html +0 -29
- package/templates/hono/dist/README/index.html +0 -104
- package/templates/hono/dist/about/index.html +0 -32
- package/templates/hono/dist/assets/Counter-CCEByS-J.js +0 -1
- package/templates/hono/dist/assets/Hero--o6WMNvm.js +0 -2
- package/templates/hono/dist/assets/de-D5r6Ye70.js +0 -10
- package/templates/hono/dist/assets/hono-BXWYYdyv.js +0 -10
- package/templates/hono/dist/assets/interactive-Bxo-WBpC.js +0 -9
- package/templates/hono/dist/assets/interactive-BznI4IQ3.js +0 -9
- package/templates/hono/dist/assets/main-Bqi-VFEk.js +0 -2
- package/templates/hono/dist/assets/main-DIIN7FO0.css +0 -1
- package/templates/hono/dist/de/about/index.html +0 -32
- package/templates/hono/dist/de/guide/commands/index.html +0 -41
- package/templates/hono/dist/de/guide/configuration/index.html +0 -105
- package/templates/hono/dist/de/guide/deploy/index.html +0 -195
- package/templates/hono/dist/de/guide/first-five-minutes/index.html +0 -99
- package/templates/hono/dist/de/guide/getting-started/index.html +0 -173
- package/templates/hono/dist/de/guide/routing/index.html +0 -165
- package/templates/hono/dist/de/guide/seiten-erstellen/index.html +0 -234
- package/templates/hono/dist/de/guide/what-is-preactpress/index.html +0 -141
- package/templates/hono/dist/de/index.html +0 -30
- package/templates/hono/dist/de/interactive/index.html +0 -37
- package/templates/hono/dist/de/markdown-examples/index.html +0 -97
- package/templates/hono/dist/de/parts/include-body/index.html +0 -36
- package/templates/hono/dist/de/tags/markdown/index.html +0 -32
- package/templates/hono/dist/favicon-32.png +0 -0
- package/templates/hono/dist/favicon.png +0 -0
- package/templates/hono/dist/favicon.svg +0 -28
- package/templates/hono/dist/guide/commands/index.html +0 -41
- package/templates/hono/dist/guide/configuration/index.html +0 -158
- package/templates/hono/dist/guide/creating-pages/index.html +0 -234
- package/templates/hono/dist/guide/deploy/index.html +0 -195
- package/templates/hono/dist/guide/first-five-minutes/index.html +0 -99
- package/templates/hono/dist/guide/getting-started/index.html +0 -173
- package/templates/hono/dist/guide/routing/index.html +0 -165
- package/templates/hono/dist/guide/what-is-preactpress/index.html +0 -141
- package/templates/hono/dist/index.html +0 -30
- package/templates/hono/dist/interactive/index.html +0 -37
- package/templates/hono/dist/markdown-examples/index.html +0 -105
- package/templates/hono/dist/partials/shared-note/index.html +0 -30
- package/templates/hono/dist/parts/include-body/index.html +0 -36
- package/templates/hono/dist/preactpress-content/404.json +0 -8
- package/templates/hono/dist/preactpress-content/README.json +0 -26
- package/templates/hono/dist/preactpress-content/about.json +0 -15
- package/templates/hono/dist/preactpress-content/de__about.json +0 -15
- package/templates/hono/dist/preactpress-content/de__guide__commands.json +0 -36
- package/templates/hono/dist/preactpress-content/de__guide__configuration.json +0 -41
- package/templates/hono/dist/preactpress-content/de__guide__deploy.json +0 -56
- package/templates/hono/dist/preactpress-content/de__guide__first-five-minutes.json +0 -36
- package/templates/hono/dist/preactpress-content/de__guide__getting-started.json +0 -51
- package/templates/hono/dist/preactpress-content/de__guide__routing.json +0 -61
- package/templates/hono/dist/preactpress-content/de__guide__seiten-erstellen.json +0 -71
- package/templates/hono/dist/preactpress-content/de__guide__what-is-preactpress.json +0 -51
- package/templates/hono/dist/preactpress-content/de__markdown-examples.json +0 -131
- package/templates/hono/dist/preactpress-content/de__parts__include-body.json +0 -16
- package/templates/hono/dist/preactpress-content/de__tags__markdown.json +0 -16
- package/templates/hono/dist/preactpress-content/guide__commands.json +0 -36
- package/templates/hono/dist/preactpress-content/guide__configuration.json +0 -51
- package/templates/hono/dist/preactpress-content/guide__creating-pages.json +0 -71
- package/templates/hono/dist/preactpress-content/guide__deploy.json +0 -56
- package/templates/hono/dist/preactpress-content/guide__first-five-minutes.json +0 -36
- package/templates/hono/dist/preactpress-content/guide__getting-started.json +0 -51
- package/templates/hono/dist/preactpress-content/guide__routing.json +0 -61
- package/templates/hono/dist/preactpress-content/guide__what-is-preactpress.json +0 -51
- package/templates/hono/dist/preactpress-content/markdown-examples.json +0 -141
- package/templates/hono/dist/preactpress-content/partials__shared-note.json +0 -10
- package/templates/hono/dist/preactpress-content/parts__include-body.json +0 -16
- package/templates/hono/dist/preactpress-content/tags__markdown.json +0 -16
- package/templates/hono/dist/preactpress-search.json +0 -242
- package/templates/hono/dist/preactpress-theme.js +0 -1
- package/templates/hono/dist/tags/markdown/index.html +0 -32
|
@@ -1,94 +1,114 @@
|
|
|
1
|
-
import { defineConfig } from
|
|
1
|
+
import { defineConfig } from "@kamod-ch/preactpress/config";
|
|
2
|
+
|
|
3
|
+
const matomoImageTracker =
|
|
4
|
+
'<!-- Matomo Image Tracker--><img referrerpolicy="no-referrer-when-downgrade" src="https://matomo.kamod.ch/matomo.php?idsite=6&rec=1" style="border:0" alt="" /><!-- End Matomo -->';
|
|
5
|
+
|
|
6
|
+
const includeMatomoImageTracker = process.env.PREACTPRESS_INCLUDE_MATOMO === "true";
|
|
2
7
|
|
|
3
8
|
export default defineConfig({
|
|
4
|
-
srcExclude: [
|
|
9
|
+
srcExclude: ["README.md", "partials/**", "parts/**"],
|
|
5
10
|
site: {
|
|
6
|
-
title:
|
|
7
|
-
description:
|
|
11
|
+
title: "PreactPress",
|
|
12
|
+
description: "The documentation framework for Preact",
|
|
8
13
|
},
|
|
9
14
|
markdown: {
|
|
10
15
|
html: false,
|
|
11
16
|
emoji: true,
|
|
12
|
-
math: true
|
|
17
|
+
math: true,
|
|
18
|
+
},
|
|
19
|
+
transformHtml(html) {
|
|
20
|
+
if (!includeMatomoImageTracker) return html;
|
|
21
|
+
return html.replace("</body>", ` ${matomoImageTracker}\n </body>`);
|
|
13
22
|
},
|
|
14
23
|
themeConfig: {
|
|
15
24
|
outline: true,
|
|
16
25
|
search: true,
|
|
17
26
|
lastUpdated: true,
|
|
18
|
-
footer:
|
|
27
|
+
footer: "Built with PreactPress.",
|
|
28
|
+
socialLinks: [
|
|
29
|
+
{
|
|
30
|
+
icon: "github",
|
|
31
|
+
link: "https://github.com/kamod-ch/preactpress",
|
|
32
|
+
ariaLabel: "PreactPress on GitHub",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
19
35
|
},
|
|
20
36
|
locales: {
|
|
21
37
|
root: {
|
|
22
|
-
label:
|
|
23
|
-
lang:
|
|
38
|
+
label: "English",
|
|
39
|
+
lang: "en",
|
|
24
40
|
themeConfig: {
|
|
25
41
|
nav: [
|
|
26
|
-
{ text:
|
|
27
|
-
{ text:
|
|
28
|
-
{ text:
|
|
42
|
+
{ text: "Guide", link: "/guide/getting-started" },
|
|
43
|
+
{ text: "Reference", link: "/guide/configuration" },
|
|
44
|
+
{ text: "Examples", link: "/markdown-examples" },
|
|
29
45
|
],
|
|
30
46
|
sidebar: [
|
|
31
47
|
{
|
|
32
|
-
text:
|
|
48
|
+
text: "Introduction",
|
|
33
49
|
items: [
|
|
34
|
-
{ text:
|
|
35
|
-
{ text:
|
|
36
|
-
{ text:
|
|
37
|
-
{ text:
|
|
38
|
-
]
|
|
50
|
+
{ text: "Overview", link: "/" },
|
|
51
|
+
{ text: "What is PreactPress?", link: "/guide/what-is-preactpress" },
|
|
52
|
+
{ text: "Getting started", link: "/guide/getting-started" },
|
|
53
|
+
{ text: "First five minutes", link: "/guide/first-five-minutes" },
|
|
54
|
+
],
|
|
39
55
|
},
|
|
40
56
|
{
|
|
41
|
-
text:
|
|
57
|
+
text: "Authoring",
|
|
42
58
|
items: [
|
|
43
|
-
{ text:
|
|
44
|
-
{ text:
|
|
45
|
-
{ text:
|
|
46
|
-
{ text:
|
|
47
|
-
]
|
|
59
|
+
{ text: "Creating pages", link: "/guide/creating-pages" },
|
|
60
|
+
{ text: "Markdown and MDX", link: "/guide/markdown-and-mdx" },
|
|
61
|
+
{ text: "Routing and i18n", link: "/guide/routing" },
|
|
62
|
+
{ text: "Default theme", link: "/guide/default-theme" },
|
|
63
|
+
],
|
|
48
64
|
},
|
|
49
65
|
{
|
|
50
|
-
text:
|
|
66
|
+
text: "Reference",
|
|
51
67
|
items: [
|
|
52
|
-
{ text:
|
|
53
|
-
{ text:
|
|
54
|
-
{ text:
|
|
55
|
-
{ text:
|
|
56
|
-
{ text:
|
|
57
|
-
]
|
|
68
|
+
{ text: "Configuration", link: "/guide/configuration" },
|
|
69
|
+
{ text: "CLI and validation", link: "/guide/commands" },
|
|
70
|
+
{ text: "Advanced APIs", link: "/guide/advanced" },
|
|
71
|
+
{ text: "Custom themes", link: "/guide/custom-themes" },
|
|
72
|
+
{ text: "Deploy", link: "/guide/deploy" },
|
|
73
|
+
],
|
|
58
74
|
},
|
|
59
75
|
{
|
|
60
|
-
text:
|
|
76
|
+
text: "Examples",
|
|
61
77
|
items: [
|
|
62
|
-
{ text:
|
|
63
|
-
{ text:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
78
|
+
{ text: "Markdown examples", link: "/markdown-examples" },
|
|
79
|
+
{ text: "Interactive MDX", link: "/interactive" },
|
|
80
|
+
{ text: "Algolia DocSearch", link: "/examples/algolia-docsearch" },
|
|
81
|
+
{ text: "Content loader", link: "/examples/content-loader" },
|
|
82
|
+
{ text: "Dynamic routes", link: "/examples/dynamic-routes" },
|
|
83
|
+
{ text: "Static assets", link: "/examples/static-assets" },
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
68
88
|
},
|
|
69
89
|
de: {
|
|
70
|
-
label:
|
|
71
|
-
lang:
|
|
72
|
-
link:
|
|
73
|
-
description:
|
|
90
|
+
label: "Deutsch",
|
|
91
|
+
lang: "de",
|
|
92
|
+
link: "/de/",
|
|
93
|
+
description: "Kleine deutschsprachige i18n-Demo für PreactPress",
|
|
74
94
|
themeConfig: {
|
|
75
|
-
footer:
|
|
95
|
+
footer: "Erstellt mit PreactPress.",
|
|
76
96
|
nav: [
|
|
77
|
-
{ text:
|
|
78
|
-
{ text:
|
|
79
|
-
{ text:
|
|
97
|
+
{ text: "Start", link: "/de" },
|
|
98
|
+
{ text: "Einführung", link: "/de/guide/what-is-preactpress" },
|
|
99
|
+
{ text: "English docs", link: "/guide/getting-started" },
|
|
80
100
|
],
|
|
81
101
|
sidebar: [
|
|
82
102
|
{
|
|
83
|
-
text:
|
|
103
|
+
text: "i18n-Demo",
|
|
84
104
|
items: [
|
|
85
|
-
{ text:
|
|
86
|
-
{ text:
|
|
87
|
-
{ text:
|
|
88
|
-
]
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
})
|
|
105
|
+
{ text: "Willkommen", link: "/de" },
|
|
106
|
+
{ text: "Was ist PreactPress?", link: "/de/guide/what-is-preactpress" },
|
|
107
|
+
{ text: "Erste Schritte", link: "/de/guide/getting-started" },
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
});
|
package/templates/docs/README.md
CHANGED
|
@@ -4,12 +4,12 @@ This is the canonical PreactPress documentation and the site created by `preactp
|
|
|
4
4
|
|
|
5
5
|
## Commands
|
|
6
6
|
|
|
7
|
-
| Script
|
|
8
|
-
|
|
|
9
|
-
| `pnpm run dev`
|
|
10
|
-
| `pnpm run check`
|
|
11
|
-
| `pnpm run build`
|
|
12
|
-
| `pnpm run preview` | Preview the production output locally
|
|
7
|
+
| Script | Purpose |
|
|
8
|
+
| ------------------ | --------------------------------------- |
|
|
9
|
+
| `pnpm run dev` | Start the docs at http://localhost:5173 |
|
|
10
|
+
| `pnpm run check` | Validate routes, config, and links |
|
|
11
|
+
| `pnpm run build` | Generate static output in `dist/` |
|
|
12
|
+
| `pnpm run preview` | Preview the production output locally |
|
|
13
13
|
|
|
14
14
|
## Structure
|
|
15
15
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** @jsx h */
|
|
2
|
+
import { h } from "preact";
|
|
3
|
+
|
|
4
|
+
const benefits = [
|
|
5
|
+
{
|
|
6
|
+
title: "Preact components in MDX",
|
|
7
|
+
details:
|
|
8
|
+
"Bring interactive examples, demos and product-specific widgets into otherwise simple content.",
|
|
9
|
+
href: "/guide/markdown-and-mdx",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: "Documentation features included",
|
|
13
|
+
details:
|
|
14
|
+
"Navigation, sidebars, local search, outlines, tags, i18n and validation are ready in the docs template.",
|
|
15
|
+
href: "/guide/configuration",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: "Static deployment anywhere",
|
|
19
|
+
details:
|
|
20
|
+
"Build once and publish the generated files to GitHub Pages, Netlify, Vercel, Cloudflare Pages or any static host.",
|
|
21
|
+
href: "/guide/deploy",
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
export default function BenefitsGrid() {
|
|
26
|
+
return (
|
|
27
|
+
<section class="pp-mkt-section" aria-labelledby="benefits-title">
|
|
28
|
+
<div class="pp-mkt-section-heading">
|
|
29
|
+
<p class="pp-mkt-eyebrow">Three main benefits</p>
|
|
30
|
+
<h2 id="benefits-title">Focused on Preact documentation</h2>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="pp-mkt-card-grid pp-mkt-card-grid-three">
|
|
33
|
+
{benefits.map((benefit, index) => (
|
|
34
|
+
<a class="pp-mkt-card" href={benefit.href} key={benefit.title}>
|
|
35
|
+
<span class="pp-mkt-card-index" aria-hidden="true">
|
|
36
|
+
0{index + 1}
|
|
37
|
+
</span>
|
|
38
|
+
<h3>{benefit.title}</h3>
|
|
39
|
+
<p>{benefit.details}</p>
|
|
40
|
+
</a>
|
|
41
|
+
))}
|
|
42
|
+
</div>
|
|
43
|
+
</section>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** @jsx h */
|
|
2
|
+
import { h } from "preact";
|
|
3
|
+
|
|
4
|
+
const commands = [
|
|
5
|
+
{ cwd: "~", cmd: "pnpm dlx @kamod-ch/preactpress init my-docs --template docs" },
|
|
6
|
+
{ cwd: "~", cmd: "cd my-docs" },
|
|
7
|
+
{ cwd: "my-docs", cmd: "pnpm install" },
|
|
8
|
+
{ cwd: "my-docs", cmd: "pnpm dev", active: true },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
export default function CliBlock() {
|
|
12
|
+
return (
|
|
13
|
+
<section class="pp-mkt-cli" aria-label="Start a PreactPress documentation site">
|
|
14
|
+
<div class="pp-mkt-code-card pp-mkt-code-card-terminal">
|
|
15
|
+
<div class="pp-mkt-code-topbar" aria-hidden="true">
|
|
16
|
+
<span />
|
|
17
|
+
<span />
|
|
18
|
+
<span />
|
|
19
|
+
<span class="pp-mkt-terminal-title">Terminal — zsh</span>
|
|
20
|
+
</div>
|
|
21
|
+
<pre>
|
|
22
|
+
<code>
|
|
23
|
+
{commands.map((command) => (
|
|
24
|
+
<span class="pp-mkt-terminal-line" key={command.cmd}>
|
|
25
|
+
<span class="pp-mkt-terminal-prompt" aria-hidden="true">
|
|
26
|
+
<span class="pp-mkt-terminal-path">{command.cwd}</span>
|
|
27
|
+
<span class="pp-mkt-terminal-caret">%</span>
|
|
28
|
+
</span>
|
|
29
|
+
<span class="pp-mkt-terminal-cmd">{command.cmd}</span>
|
|
30
|
+
{command.active ? <span class="pp-mkt-terminal-cursor" aria-hidden="true" /> : null}
|
|
31
|
+
</span>
|
|
32
|
+
))}
|
|
33
|
+
</code>
|
|
34
|
+
</pre>
|
|
35
|
+
</div>
|
|
36
|
+
</section>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** @jsx h */
|
|
2
|
+
import { h } from "preact";
|
|
3
|
+
|
|
4
|
+
const products = [
|
|
5
|
+
{
|
|
6
|
+
product: "PreactPress",
|
|
7
|
+
components: "Preact + MDX",
|
|
8
|
+
focus: "Preact documentation",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
product: "VitePress",
|
|
12
|
+
components: "Vue",
|
|
13
|
+
focus: "Vue documentation",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
product: "Docusaurus",
|
|
17
|
+
components: "React",
|
|
18
|
+
focus: "Large documentation portals",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
product: "Starlight",
|
|
22
|
+
components: "Astro",
|
|
23
|
+
focus: "Cross-framework content sites",
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
export default function ComparisonTable() {
|
|
28
|
+
return (
|
|
29
|
+
<section class="pp-mkt-section" aria-labelledby="comparison-title">
|
|
30
|
+
<div class="pp-mkt-section-heading">
|
|
31
|
+
<p class="pp-mkt-eyebrow">Comparison</p>
|
|
32
|
+
<h2 id="comparison-title">Pick the documentation tool that matches your stack</h2>
|
|
33
|
+
<p>
|
|
34
|
+
Each tool has a clear audience. PreactPress is for teams that want documentation built
|
|
35
|
+
around Preact and MDX.
|
|
36
|
+
</p>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="pp-mkt-table-wrap">
|
|
39
|
+
<table class="pp-mkt-table">
|
|
40
|
+
<thead>
|
|
41
|
+
<tr>
|
|
42
|
+
<th scope="col">Product</th>
|
|
43
|
+
<th scope="col">Components</th>
|
|
44
|
+
<th scope="col">Best for</th>
|
|
45
|
+
</tr>
|
|
46
|
+
</thead>
|
|
47
|
+
<tbody>
|
|
48
|
+
{products.map((product) => (
|
|
49
|
+
<tr key={product.product}>
|
|
50
|
+
<th scope="row">{product.product}</th>
|
|
51
|
+
<td>{product.components}</td>
|
|
52
|
+
<td>{product.focus}</td>
|
|
53
|
+
</tr>
|
|
54
|
+
))}
|
|
55
|
+
</tbody>
|
|
56
|
+
</table>
|
|
57
|
+
</div>
|
|
58
|
+
</section>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** @jsx h */
|
|
2
|
+
import { h } from "preact";
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "preact/hooks";
|
|
4
|
+
|
|
5
|
+
async function copyText(text: string): Promise<void> {
|
|
6
|
+
if (navigator.clipboard?.writeText) {
|
|
7
|
+
await navigator.clipboard.writeText(text);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const textarea = document.createElement("textarea");
|
|
12
|
+
textarea.value = text;
|
|
13
|
+
textarea.setAttribute("readonly", "");
|
|
14
|
+
textarea.style.position = "fixed";
|
|
15
|
+
textarea.style.left = "-9999px";
|
|
16
|
+
document.body.appendChild(textarea);
|
|
17
|
+
textarea.select();
|
|
18
|
+
document.execCommand("copy");
|
|
19
|
+
document.body.removeChild(textarea);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default function CopyableCommand({ command }: { command: string }) {
|
|
23
|
+
const [copied, setCopied] = useState(false);
|
|
24
|
+
const resetTimer = useRef<number | undefined>(undefined);
|
|
25
|
+
|
|
26
|
+
const copy = useCallback(async () => {
|
|
27
|
+
try {
|
|
28
|
+
await copyText(command);
|
|
29
|
+
setCopied(true);
|
|
30
|
+
window.clearTimeout(resetTimer.current);
|
|
31
|
+
resetTimer.current = window.setTimeout(() => setCopied(false), 2000);
|
|
32
|
+
} catch {
|
|
33
|
+
setCopied(false);
|
|
34
|
+
}
|
|
35
|
+
}, [command]);
|
|
36
|
+
|
|
37
|
+
useEffect(() => () => window.clearTimeout(resetTimer.current), []);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div class="pp-mkt-copyable">
|
|
41
|
+
<code class="pp-mkt-copyable-code">{command}</code>
|
|
42
|
+
<button
|
|
43
|
+
type="button"
|
|
44
|
+
class={`pp-mkt-copy-btn${copied ? " pp-mkt-copy-btn-copied" : ""}`}
|
|
45
|
+
onClick={copy}
|
|
46
|
+
aria-label={copied ? "Command copied" : "Copy command"}
|
|
47
|
+
title={copied ? "Copied" : "Copy command"}
|
|
48
|
+
>
|
|
49
|
+
{copied ? (
|
|
50
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
|
51
|
+
<path
|
|
52
|
+
d="M20 6 9 17l-5-5"
|
|
53
|
+
fill="none"
|
|
54
|
+
stroke="currentColor"
|
|
55
|
+
stroke-linecap="round"
|
|
56
|
+
stroke-linejoin="round"
|
|
57
|
+
stroke-width="2"
|
|
58
|
+
/>
|
|
59
|
+
</svg>
|
|
60
|
+
) : (
|
|
61
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
|
62
|
+
<rect
|
|
63
|
+
x="9"
|
|
64
|
+
y="9"
|
|
65
|
+
width="11"
|
|
66
|
+
height="11"
|
|
67
|
+
rx="2"
|
|
68
|
+
fill="none"
|
|
69
|
+
stroke="currentColor"
|
|
70
|
+
stroke-width="2"
|
|
71
|
+
/>
|
|
72
|
+
<path
|
|
73
|
+
d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"
|
|
74
|
+
fill="none"
|
|
75
|
+
stroke="currentColor"
|
|
76
|
+
stroke-linecap="round"
|
|
77
|
+
stroke-linejoin="round"
|
|
78
|
+
stroke-width="2"
|
|
79
|
+
/>
|
|
80
|
+
</svg>
|
|
81
|
+
)}
|
|
82
|
+
<span class="pp-mkt-copy-btn-label">{copied ? "Copied" : "Copy"}</span>
|
|
83
|
+
</button>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useState } from
|
|
1
|
+
import { useState } from "preact/hooks";
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
const [count, setCount] = useState(initial)
|
|
3
|
+
export function Counter({ initial = 0 }: { initial?: number }) {
|
|
4
|
+
const [count, setCount] = useState(initial);
|
|
5
5
|
|
|
6
6
|
return (
|
|
7
|
-
<div style={{ display:
|
|
7
|
+
<div style={{ display: "inline-flex", alignItems: "center", gap: "0.5rem" }}>
|
|
8
8
|
<button
|
|
9
9
|
type="button"
|
|
10
10
|
onClick={() => setCount((value) => value - 1)}
|
|
@@ -21,5 +21,7 @@ export default function Counter({ initial = 0 }: { initial?: number }) {
|
|
|
21
21
|
+
|
|
22
22
|
</button>
|
|
23
23
|
</div>
|
|
24
|
-
)
|
|
24
|
+
);
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
export default Counter;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** @jsx h */
|
|
2
|
+
import { h } from "preact";
|
|
3
|
+
|
|
4
|
+
const actions = [
|
|
5
|
+
{ text: "Get started", href: "/guide/getting-started", theme: "brand" },
|
|
6
|
+
{ text: "View demo", href: "#interactive-demo", theme: "alt" },
|
|
7
|
+
{
|
|
8
|
+
text: "GitHub",
|
|
9
|
+
href: "https://github.com/kamod-ch/preactpress",
|
|
10
|
+
theme: "ghost",
|
|
11
|
+
external: true,
|
|
12
|
+
},
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
export default function MarketingHero() {
|
|
16
|
+
return (
|
|
17
|
+
<section class="pp-mkt-hero" aria-labelledby="preactpress-hero-title">
|
|
18
|
+
<div class="pp-mkt-hero-copy">
|
|
19
|
+
<p class="pp-mkt-eyebrow">PreactPress</p>
|
|
20
|
+
<h1 id="preactpress-hero-title">The documentation framework for Preact</h1>
|
|
21
|
+
<p class="pp-mkt-hero-lead">
|
|
22
|
+
Build fast documentation, blogs and product sites with Markdown, MDX, Preact and Vite.
|
|
23
|
+
</p>
|
|
24
|
+
<div class="pp-mkt-actions">
|
|
25
|
+
{actions.map((action) => (
|
|
26
|
+
<a
|
|
27
|
+
class={`pp-mkt-button pp-mkt-button-${action.theme}`}
|
|
28
|
+
href={action.href}
|
|
29
|
+
key={action.text}
|
|
30
|
+
rel={action.external ? "noopener noreferrer" : undefined}
|
|
31
|
+
target={action.external ? "_blank" : undefined}
|
|
32
|
+
>
|
|
33
|
+
{action.text}
|
|
34
|
+
</a>
|
|
35
|
+
))}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="pp-mkt-hero-panel" aria-label="PreactPress workflow">
|
|
39
|
+
<span class="pp-mkt-panel-label">Markdown</span>
|
|
40
|
+
<span class="pp-mkt-panel-label">MDX</span>
|
|
41
|
+
<span class="pp-mkt-panel-label">Preact</span>
|
|
42
|
+
<span class="pp-mkt-panel-arrow" aria-hidden="true">
|
|
43
|
+
<svg
|
|
44
|
+
class="pp-mkt-panel-arrow-icon"
|
|
45
|
+
viewBox="0 0 24 24"
|
|
46
|
+
aria-hidden="true"
|
|
47
|
+
focusable="false"
|
|
48
|
+
>
|
|
49
|
+
<path
|
|
50
|
+
d="M12 5v10M8 11l4 4 4-4"
|
|
51
|
+
fill="none"
|
|
52
|
+
stroke="currentColor"
|
|
53
|
+
stroke-linecap="round"
|
|
54
|
+
stroke-linejoin="round"
|
|
55
|
+
stroke-width="2"
|
|
56
|
+
/>
|
|
57
|
+
</svg>
|
|
58
|
+
</span>
|
|
59
|
+
<strong>Static docs</strong>
|
|
60
|
+
</div>
|
|
61
|
+
</section>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/** @jsx h */
|
|
2
|
+
import { h } from "preact";
|
|
3
|
+
import { Counter } from "./Counter.tsx";
|
|
4
|
+
|
|
5
|
+
const sourceLines = [
|
|
6
|
+
{
|
|
7
|
+
line: 1,
|
|
8
|
+
parts: [
|
|
9
|
+
{ kind: "keyword", text: "import" },
|
|
10
|
+
{ kind: "plain", text: " { Counter } " },
|
|
11
|
+
{ kind: "keyword", text: "from" },
|
|
12
|
+
{ kind: "string", text: "'./components/Counter'" },
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
{ line: 2, parts: [] },
|
|
16
|
+
{
|
|
17
|
+
line: 3,
|
|
18
|
+
parts: [{ kind: "heading", text: "# Interactive documentation" }],
|
|
19
|
+
},
|
|
20
|
+
{ line: 4, parts: [] },
|
|
21
|
+
{
|
|
22
|
+
line: 5,
|
|
23
|
+
parts: [{ kind: "component", text: "<Counter />" }],
|
|
24
|
+
active: true,
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
function EditorToken({ kind, text }: { kind: string; text: string }) {
|
|
29
|
+
return <span class={`pp-mkt-editor-token pp-mkt-editor-token-${kind}`}>{text}</span>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default function MdxDemo() {
|
|
33
|
+
return (
|
|
34
|
+
<section
|
|
35
|
+
class="pp-mkt-section pp-mkt-demo"
|
|
36
|
+
id="interactive-demo"
|
|
37
|
+
aria-labelledby="interactive-demo-title"
|
|
38
|
+
>
|
|
39
|
+
<div class="pp-mkt-section-heading">
|
|
40
|
+
<p class="pp-mkt-eyebrow">Interactive demo</p>
|
|
41
|
+
<h2 id="interactive-demo-title">A small MDX example</h2>
|
|
42
|
+
<p>
|
|
43
|
+
Author mostly in Markdown, then drop in Preact components exactly where the page needs
|
|
44
|
+
interactivity.
|
|
45
|
+
</p>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="pp-mkt-demo-grid">
|
|
48
|
+
<div class="pp-mkt-demo-code">
|
|
49
|
+
<div class="pp-mkt-code-card pp-mkt-code-card-editor">
|
|
50
|
+
<div class="pp-mkt-code-topbar" aria-hidden="true">
|
|
51
|
+
<span />
|
|
52
|
+
<span />
|
|
53
|
+
<span />
|
|
54
|
+
<span class="pp-mkt-editor-title">
|
|
55
|
+
<span class="pp-mkt-editor-tab">pages/interactive.mdx</span>
|
|
56
|
+
</span>
|
|
57
|
+
</div>
|
|
58
|
+
<pre>
|
|
59
|
+
<code>
|
|
60
|
+
{sourceLines.map((sourceLine) => (
|
|
61
|
+
<span
|
|
62
|
+
class={`pp-mkt-editor-line${sourceLine.active ? " pp-mkt-editor-line-active" : ""}`}
|
|
63
|
+
key={sourceLine.line}
|
|
64
|
+
>
|
|
65
|
+
<span class="pp-mkt-editor-gutter" aria-hidden="true">
|
|
66
|
+
{sourceLine.line}
|
|
67
|
+
</span>
|
|
68
|
+
<span class="pp-mkt-editor-content">
|
|
69
|
+
{sourceLine.parts.map((part) => (
|
|
70
|
+
<EditorToken
|
|
71
|
+
kind={part.kind}
|
|
72
|
+
key={`${sourceLine.line}-${part.text}`}
|
|
73
|
+
text={part.text}
|
|
74
|
+
/>
|
|
75
|
+
))}
|
|
76
|
+
{sourceLine.active ? (
|
|
77
|
+
<span class="pp-mkt-editor-cursor" aria-hidden="true" />
|
|
78
|
+
) : null}
|
|
79
|
+
</span>
|
|
80
|
+
</span>
|
|
81
|
+
))}
|
|
82
|
+
</code>
|
|
83
|
+
</pre>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<div class="pp-mkt-demo-result" aria-label="Rendered MDX result">
|
|
87
|
+
<article>
|
|
88
|
+
<p class="pp-mkt-demo-label">Rendered result</p>
|
|
89
|
+
<h3>Interactive documentation</h3>
|
|
90
|
+
<Counter />
|
|
91
|
+
</article>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</section>
|
|
95
|
+
);
|
|
96
|
+
}
|