create-zudo-doc 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +146 -0
- package/bin/create-zudo-doc.js +2 -0
- package/dist/api.d.ts +20 -0
- package/dist/api.js +13 -0
- package/dist/claude-md-gen.d.ts +2 -0
- package/dist/claude-md-gen.js +113 -0
- package/dist/cli.d.ts +39 -0
- package/dist/cli.js +157 -0
- package/dist/compose.d.ts +95 -0
- package/dist/compose.js +206 -0
- package/dist/constants.d.ts +20 -0
- package/dist/constants.js +224 -0
- package/dist/features/body-foot-util.d.ts +10 -0
- package/dist/features/body-foot-util.js +12 -0
- package/dist/features/claude-resources.d.ts +2 -0
- package/dist/features/claude-resources.js +6 -0
- package/dist/features/design-token-panel.d.ts +14 -0
- package/dist/features/design-token-panel.js +27 -0
- package/dist/features/doc-history.d.ts +9 -0
- package/dist/features/doc-history.js +11 -0
- package/dist/features/doc-tags.d.ts +19 -0
- package/dist/features/doc-tags.js +33 -0
- package/dist/features/footer-taglist.d.ts +14 -0
- package/dist/features/footer-taglist.js +17 -0
- package/dist/features/footer.d.ts +8 -0
- package/dist/features/footer.js +10 -0
- package/dist/features/i18n.d.ts +22 -0
- package/dist/features/i18n.js +41 -0
- package/dist/features/image-enlarge.d.ts +11 -0
- package/dist/features/image-enlarge.js +13 -0
- package/dist/features/index.d.ts +15 -0
- package/dist/features/index.js +53 -0
- package/dist/features/llms-txt.d.ts +11 -0
- package/dist/features/llms-txt.js +13 -0
- package/dist/features/search.d.ts +9 -0
- package/dist/features/search.js +11 -0
- package/dist/features/sidebar-resizer.d.ts +14 -0
- package/dist/features/sidebar-resizer.js +16 -0
- package/dist/features/sidebar-toggle.d.ts +13 -0
- package/dist/features/sidebar-toggle.js +15 -0
- package/dist/features/tag-governance.d.ts +14 -0
- package/dist/features/tag-governance.js +16 -0
- package/dist/features/tauri-dev.d.ts +2 -0
- package/dist/features/tauri-dev.js +25 -0
- package/dist/features/tauri.d.ts +11 -0
- package/dist/features/tauri.js +52 -0
- package/dist/features/versioning.d.ts +27 -0
- package/dist/features/versioning.js +43 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +150 -0
- package/dist/preset.d.ts +37 -0
- package/dist/preset.js +156 -0
- package/dist/prompts.d.ts +32 -0
- package/dist/prompts.js +248 -0
- package/dist/scaffold.d.ts +4 -0
- package/dist/scaffold.js +344 -0
- package/dist/settings-gen.d.ts +2 -0
- package/dist/settings-gen.js +237 -0
- package/dist/utils.d.ts +8 -0
- package/dist/utils.js +34 -0
- package/dist/zfb-config-gen.d.ts +19 -0
- package/dist/zfb-config-gen.js +222 -0
- package/package.json +65 -0
- package/templates/base/.htmlvalidate.json +5 -0
- package/templates/base/.zfb/doc-history-meta.json +1 -0
- package/templates/base/pages/404.tsx +55 -0
- package/templates/base/pages/_data.ts +179 -0
- package/templates/base/pages/_mdx-components.ts +249 -0
- package/templates/base/pages/docs/[...slug].tsx +448 -0
- package/templates/base/pages/index.tsx +158 -0
- package/templates/base/pages/lib/_body-end-islands.tsx +201 -0
- package/templates/base/pages/lib/_category-nav.tsx +148 -0
- package/templates/base/pages/lib/_category-tree-nav.tsx +104 -0
- package/templates/base/pages/lib/_compose-meta-title.ts +29 -0
- package/templates/base/pages/lib/_details.tsx +30 -0
- package/templates/base/pages/lib/_doc-history-area.tsx +178 -0
- package/templates/base/pages/lib/_doc-metainfo-area.tsx +100 -0
- package/templates/base/pages/lib/_doc-tags-area.tsx +89 -0
- package/templates/base/pages/lib/_extract-headings.ts +81 -0
- package/templates/base/pages/lib/_footer-with-defaults.tsx +234 -0
- package/templates/base/pages/lib/_frontmatter-preview-data.ts +53 -0
- package/templates/base/pages/lib/_head-with-defaults.tsx +113 -0
- package/templates/base/pages/lib/_header-with-defaults.tsx +386 -0
- package/templates/base/pages/lib/_inline-version-switcher.tsx +84 -0
- package/templates/base/pages/lib/_math-block.tsx +63 -0
- package/templates/base/pages/lib/_nav-source-docs.ts +68 -0
- package/templates/base/pages/lib/_preset-generator.tsx +81 -0
- package/templates/base/pages/lib/_search-widget-script.ts +388 -0
- package/templates/base/pages/lib/_search-widget.tsx +196 -0
- package/templates/base/pages/lib/_sidebar-with-defaults.tsx +176 -0
- package/templates/base/pages/lib/_site-tree-nav.tsx +128 -0
- package/templates/base/pages/lib/locale-merge.ts +58 -0
- package/templates/base/pages/lib/route-enumerators.ts +302 -0
- package/templates/base/pages/sitemap.xml.tsx +51 -0
- package/templates/base/plugins/connect-adapter.mjs +144 -0
- package/templates/base/plugins/copy-public-plugin.mjs +50 -0
- package/templates/base/plugins/search-index-plugin.mjs +54 -0
- package/templates/base/scripts/run-b4push.sh +102 -0
- package/templates/base/src/components/ai-chat-modal.tsx +15 -0
- package/templates/base/src/components/client-router-bootstrap.tsx +14 -0
- package/templates/base/src/components/content/component-map.ts +25 -0
- package/templates/base/src/components/content/content-blockquote.tsx +16 -0
- package/templates/base/src/components/content/content-code.tsx +117 -0
- package/templates/base/src/components/content/content-link.tsx +83 -0
- package/templates/base/src/components/content/content-ol.tsx +19 -0
- package/templates/base/src/components/content/content-paragraph.tsx +10 -0
- package/templates/base/src/components/content/content-strong.tsx +16 -0
- package/templates/base/src/components/content/content-table.tsx +18 -0
- package/templates/base/src/components/content/content-ul.tsx +18 -0
- package/templates/base/src/components/content/heading-h2.tsx +26 -0
- package/templates/base/src/components/content/heading-h3.tsx +26 -0
- package/templates/base/src/components/content/heading-h4.tsx +26 -0
- package/templates/base/src/components/design-token-panel-bootstrap.tsx +15 -0
- package/templates/base/src/components/desktop-sidebar-toggle.tsx +15 -0
- package/templates/base/src/components/doc-history.tsx +18 -0
- package/templates/base/src/components/html-preview/highlighted-code.tsx +74 -0
- package/templates/base/src/components/html-preview/html-preview.tsx +108 -0
- package/templates/base/src/components/html-preview/preflight.ts +112 -0
- package/templates/base/src/components/html-preview/preview-base.tsx +159 -0
- package/templates/base/src/components/image-enlarge.tsx +19 -0
- package/templates/base/src/components/mobile-toc.tsx +94 -0
- package/templates/base/src/components/preset-generator.tsx +14 -0
- package/templates/base/src/components/sidebar-toggle.tsx +98 -0
- package/templates/base/src/components/sidebar-tree.tsx +543 -0
- package/templates/base/src/components/site-tree-nav.tsx +233 -0
- package/templates/base/src/components/theme-toggle.tsx +93 -0
- package/templates/base/src/components/toc.tsx +63 -0
- package/templates/base/src/components/tree-nav-shared.tsx +71 -0
- package/templates/base/src/config/color-scheme-utils.ts +182 -0
- package/templates/base/src/config/color-schemes.ts +128 -0
- package/templates/base/src/config/frontmatter-preview-defaults.ts +24 -0
- package/templates/base/src/config/frontmatter-preview-renderers.tsx +46 -0
- package/templates/base/src/config/i18n.ts +225 -0
- package/templates/base/src/config/settings-types.ts +162 -0
- package/templates/base/src/config/sidebars.ts +66 -0
- package/templates/base/src/config/tag-vocabulary-types.ts +39 -0
- package/templates/base/src/config/tag-vocabulary.ts +20 -0
- package/templates/base/src/hooks/use-active-heading.ts +133 -0
- package/templates/base/src/plugins/docs-source-map.ts +103 -0
- package/templates/base/src/plugins/hast-utils.ts +10 -0
- package/templates/base/src/plugins/rehype-code-title.ts +50 -0
- package/templates/base/src/plugins/rehype-heading-links.ts +53 -0
- package/templates/base/src/plugins/rehype-image-enlarge.ts +113 -0
- package/templates/base/src/plugins/rehype-mermaid.ts +41 -0
- package/templates/base/src/plugins/rehype-strip-md-extension.ts +58 -0
- package/templates/base/src/plugins/remark-admonitions.ts +99 -0
- package/templates/base/src/plugins/remark-resolve-markdown-links.ts +127 -0
- package/templates/base/src/plugins/url-utils.ts +4 -0
- package/templates/base/src/styles/global.css +1066 -0
- package/templates/base/src/types/docs-entry.ts +39 -0
- package/templates/base/src/types/heading.ts +5 -0
- package/templates/base/src/types/locale.ts +10 -0
- package/templates/base/src/utils/base.ts +139 -0
- package/templates/base/src/utils/content-files.ts +106 -0
- package/templates/base/src/utils/dedent.ts +24 -0
- package/templates/base/src/utils/docs.ts +335 -0
- package/templates/base/src/utils/git-info.ts +70 -0
- package/templates/base/src/utils/github.ts +19 -0
- package/templates/base/src/utils/header-right-items.ts +38 -0
- package/templates/base/src/utils/nav-scope.ts +63 -0
- package/templates/base/src/utils/sidebar.ts +104 -0
- package/templates/base/src/utils/slug.ts +10 -0
- package/templates/base/src/utils/smart-break.tsx +126 -0
- package/templates/base/src/utils/tags.ts +126 -0
- package/templates/base/tsconfig.json +36 -0
- package/templates/features/bodyFootUtil/files/src/utils/github.ts +19 -0
- package/templates/features/claudeResources/files/plugins/claude-resources-plugin.mjs +137 -0
- package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/escape-for-mdx.test.ts +34 -0
- package/templates/features/claudeResources/files/src/integrations/claude-resources/__tests__/generate.test.ts +376 -0
- package/templates/features/claudeResources/files/src/integrations/claude-resources/escape-for-mdx.ts +93 -0
- package/templates/features/claudeResources/files/src/integrations/claude-resources/generate.ts +586 -0
- package/templates/features/designTokenPanel/files/src/components/design-token-panel-bootstrap.tsx +15 -0
- package/templates/features/designTokenPanel/files/src/config/design-token-panel-config.ts +99 -0
- package/templates/features/designTokenPanel/files/src/config/design-tokens-manifest.ts +177 -0
- package/templates/features/designTokenPanel/files/src/lib/design-token-panel-bootstrap.ts +50 -0
- package/templates/features/docHistory/files/plugins/doc-history-plugin.mjs +99 -0
- package/templates/features/docHistory/files/src/components/doc-history.tsx +598 -0
- package/templates/features/docHistory/files/src/types/doc-history.ts +23 -0
- package/templates/features/docHistory/files/src/utils/doc-history.ts +180 -0
- package/templates/features/docTags/files/pages/[locale]/docs/tags/[tag].tsx +116 -0
- package/templates/features/docTags/files/pages/[locale]/docs/tags/index.tsx +99 -0
- package/templates/features/docTags/files/pages/docs/tags/[tag].tsx +101 -0
- package/templates/features/docTags/files/pages/docs/tags/index.tsx +86 -0
- package/templates/features/i18n/files/pages/[locale]/docs/[...slug].tsx +467 -0
- package/templates/features/i18n/files/pages/[locale]/index.tsx +213 -0
- package/templates/features/imageEnlarge/files/src/components/image-enlarge.tsx +248 -0
- package/templates/features/llmsTxt/files/plugins/llms-txt-plugin.mjs +74 -0
- package/templates/features/sidebarResizer/files/src/scripts/sidebar-resizer.ts +185 -0
- package/templates/features/sidebarToggle/files/src/components/desktop-sidebar-toggle.tsx +126 -0
- package/templates/features/tagGovernance/files/scripts/tags-audit.ts +576 -0
- package/templates/features/tagGovernance/files/scripts/tags-suggest.ts +428 -0
- package/templates/features/tauri/files/src/components/find-bar.tsx +122 -0
- package/templates/features/tauri/files/src/components/find-in-page-init.tsx +53 -0
- package/templates/features/tauri/files/src/utils/find-in-page.ts +175 -0
- package/templates/features/tauri/files/src-tauri/Cargo.toml +14 -0
- package/templates/features/tauri/files/src-tauri/build.rs +3 -0
- package/templates/features/tauri/files/src-tauri/capabilities/default.json +11 -0
- package/templates/features/tauri/files/src-tauri/src/main.rs +250 -0
- package/templates/features/tauri/files/src-tauri/tauri.conf.json +25 -0
- package/templates/features/tauriDev/files/src-tauri-dev/Cargo.toml +15 -0
- package/templates/features/tauriDev/files/src-tauri-dev/build.rs +3 -0
- package/templates/features/tauriDev/files/src-tauri-dev/capabilities/default.json +7 -0
- package/templates/features/tauriDev/files/src-tauri-dev/frontend/index.html +187 -0
- package/templates/features/tauriDev/files/src-tauri-dev/icons/icon.png +0 -0
- package/templates/features/tauriDev/files/src-tauri-dev/src/main.rs +995 -0
- package/templates/features/tauriDev/files/src-tauri-dev/tauri.conf.json +22 -0
- package/templates/features/tauriDev/files/src-tauri-dev/test-launch.sh +65 -0
- package/templates/features/versioning/files/pages/[locale]/docs/versions.tsx +100 -0
- package/templates/features/versioning/files/pages/docs/versions.tsx +78 -0
- package/templates/features/versioning/files/pages/v/[version]/docs/[...slug].tsx +451 -0
- package/templates/features/versioning/files/pages/v/[version]/ja/docs/[...slug].tsx +490 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"productName": "zudo-doc dev",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"identifier": "com.takazudo.zudo-doc-dev",
|
|
5
|
+
"build": {
|
|
6
|
+
"frontendDist": "./frontend",
|
|
7
|
+
"beforeDevCommand": "cd .. && pnpm dev",
|
|
8
|
+
"devUrl": "http://localhost:4321/"
|
|
9
|
+
},
|
|
10
|
+
"app": {
|
|
11
|
+
"windows": [],
|
|
12
|
+
"withGlobalTauri": true,
|
|
13
|
+
"security": { "csp": null }
|
|
14
|
+
},
|
|
15
|
+
"bundle": {
|
|
16
|
+
"active": true,
|
|
17
|
+
"targets": "all",
|
|
18
|
+
"icon": ["icons/icon.png"],
|
|
19
|
+
"category": "DeveloperTool",
|
|
20
|
+
"macOS": { "minimumSystemVersion": "10.15" }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Test script: launch app via open (Finder simulation), verify dev server loads.
|
|
3
|
+
# Usage: bash test-launch.sh [count]
|
|
4
|
+
# count — number of launch iterations (default 3)
|
|
5
|
+
# Exits 0 on success, 1 on failure.
|
|
6
|
+
#
|
|
7
|
+
# The script reads the port from devServerUrl in a known test config.json, or
|
|
8
|
+
# accepts it via the DEV_PORT env var. Readiness is checked by curling
|
|
9
|
+
# <devServerUrl>/ (root), not /___ready — zfb dev server has no /___ready endpoint.
|
|
10
|
+
#
|
|
11
|
+
# The app must already be built: src-tauri-dev/target/release/bundle/macos/zudo-doc\ dev.app
|
|
12
|
+
|
|
13
|
+
COUNT=${1:-3}
|
|
14
|
+
PASS=0
|
|
15
|
+
FAIL=0
|
|
16
|
+
|
|
17
|
+
# Port to check: parse from test config, or fall back to env var / default 4321
|
|
18
|
+
TEST_CONFIG="${HOME}/Library/Application Support/com.takazudo.zudo-doc-dev/config.json"
|
|
19
|
+
if [ -f "$TEST_CONFIG" ]; then
|
|
20
|
+
DEV_SERVER_URL=$(python3 -c "import json,sys; d=json.load(open(sys.argv[1])); print(d.get('devServerUrl',''))" "$TEST_CONFIG" 2>/dev/null)
|
|
21
|
+
DEV_PORT=$(echo "$DEV_SERVER_URL" | sed 's/.*:\([0-9]*\).*/\1/')
|
|
22
|
+
fi
|
|
23
|
+
DEV_PORT="${DEV_PORT:-${DEV_PORT_OVERRIDE:-4321}}"
|
|
24
|
+
READY_URL="http://localhost:${DEV_PORT}/"
|
|
25
|
+
|
|
26
|
+
echo "Using port: ${DEV_PORT} (ready URL: ${READY_URL})"
|
|
27
|
+
|
|
28
|
+
for RUN in $(seq 1 "$COUNT"); do
|
|
29
|
+
echo "=== Run $RUN/$COUNT ==="
|
|
30
|
+
|
|
31
|
+
# Kill everything
|
|
32
|
+
ps aux | grep "zudo-doc-dev" | grep -v grep | awk '{print $2}' | xargs kill 2>/dev/null
|
|
33
|
+
lsof -ti :"$DEV_PORT" | xargs kill 2>/dev/null
|
|
34
|
+
sleep 3
|
|
35
|
+
|
|
36
|
+
# Launch via open (use build output or override)
|
|
37
|
+
APP_PATH="${APP_OVERRIDE:-$(dirname "$0")/target/release/bundle/macos/zudo-doc dev.app}"
|
|
38
|
+
open "$APP_PATH"
|
|
39
|
+
|
|
40
|
+
# Wait up to 60s for dev server to be available
|
|
41
|
+
OK=0
|
|
42
|
+
for i in $(seq 1 20); do
|
|
43
|
+
sleep 3
|
|
44
|
+
READY=$(curl -s -o /dev/null -w "%{http_code}" "$READY_URL" 2>/dev/null)
|
|
45
|
+
if [ "$READY" = "200" ]; then
|
|
46
|
+
echo " Run $RUN: PASS (ready at $((i*3))s, HTTP 200 at ${READY_URL})"
|
|
47
|
+
OK=1
|
|
48
|
+
PASS=$((PASS + 1))
|
|
49
|
+
break
|
|
50
|
+
fi
|
|
51
|
+
done
|
|
52
|
+
|
|
53
|
+
if [ "$OK" = "0" ]; then
|
|
54
|
+
echo " Run $RUN: FAIL (server not ready after 60s)"
|
|
55
|
+
FAIL=$((FAIL + 1))
|
|
56
|
+
fi
|
|
57
|
+
done
|
|
58
|
+
|
|
59
|
+
# Cleanup
|
|
60
|
+
ps aux | grep "zudo-doc-dev" | grep -v grep | awk '{print $2}' | xargs kill 2>/dev/null
|
|
61
|
+
lsof -ti :"$DEV_PORT" | xargs kill 2>/dev/null
|
|
62
|
+
|
|
63
|
+
echo ""
|
|
64
|
+
echo "=== Results: $PASS/$COUNT passed, $FAIL failed ==="
|
|
65
|
+
[ "$FAIL" -gt 0 ] && exit 1 || exit 0
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
// Port of src/pages/[locale]/docs/versions.astro → zfb page module.
|
|
4
|
+
//
|
|
5
|
+
// Non-default-locale versions page. paths() emits one route per locale in
|
|
6
|
+
// settings.locales. Locale string is passed as a prop to drive label
|
|
7
|
+
// translation in the component.
|
|
8
|
+
//
|
|
9
|
+
// paths() contract (zfb ADR-004 — synchronous):
|
|
10
|
+
// params: { locale: string }
|
|
11
|
+
// props: { locale }
|
|
12
|
+
|
|
13
|
+
import { settings } from "@/config/settings";
|
|
14
|
+
import { t } from "@/config/i18n";
|
|
15
|
+
import { withBase } from "@/utils/base";
|
|
16
|
+
import { DocLayoutWithDefaults } from "@takazudo/zudo-doc/doclayout";
|
|
17
|
+
import { VersionsPageContent } from "@takazudo/zudo-doc/nav-indexing";
|
|
18
|
+
import type { VersionPageEntry, VersionsPageLabels } from "@takazudo/zudo-doc/nav-indexing";
|
|
19
|
+
import type { JSX } from "preact";
|
|
20
|
+
import { FooterWithDefaults } from "../../lib/_footer-with-defaults";
|
|
21
|
+
import { HeaderWithDefaults } from "../../lib/_header-with-defaults";
|
|
22
|
+
import { HeadWithDefaults } from "../../lib/_head-with-defaults";
|
|
23
|
+
import { composeMetaTitle } from "../../lib/_compose-meta-title";
|
|
24
|
+
import { BodyEndIslands } from "../../lib/_body-end-islands";
|
|
25
|
+
|
|
26
|
+
export const frontmatter = { title: "Versions" };
|
|
27
|
+
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
// paths() — synchronous (ADR-004)
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
|
|
32
|
+
/** One route per non-default locale. */
|
|
33
|
+
export function paths(): Array<{
|
|
34
|
+
params: { locale: string };
|
|
35
|
+
props: { locale: string };
|
|
36
|
+
}> {
|
|
37
|
+
return Object.keys(settings.locales).map((locale) => ({
|
|
38
|
+
params: { locale },
|
|
39
|
+
props: { locale },
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
// Page component
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
interface PageArgs {
|
|
48
|
+
params: { locale: string };
|
|
49
|
+
props: { locale: string };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default function LocaleVersionsPage({ params }: PageArgs): JSX.Element {
|
|
53
|
+
const locale = params.locale;
|
|
54
|
+
const pageTitle = t("version.page.title", locale);
|
|
55
|
+
|
|
56
|
+
const labels: VersionsPageLabels = {
|
|
57
|
+
pageTitle,
|
|
58
|
+
latestTitle: t("version.page.latest.title", locale),
|
|
59
|
+
latestDescription: t("version.page.latest.description", locale),
|
|
60
|
+
latestLink: t("version.page.latest.link", locale),
|
|
61
|
+
pastTitle: t("version.page.past.title", locale),
|
|
62
|
+
pastDescription: t("version.page.past.description", locale),
|
|
63
|
+
unmaintained: t("version.page.unmaintained", locale),
|
|
64
|
+
unreleased: t("version.page.unreleased", locale),
|
|
65
|
+
versionCol: t("version.switcher.label", locale),
|
|
66
|
+
statusCol: t("version.page.status", locale),
|
|
67
|
+
docsCol: t("version.page.docs", locale),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const latestHref = withBase(`/${locale}/docs/getting-started`);
|
|
71
|
+
|
|
72
|
+
const versions: VersionPageEntry[] = settings.versions
|
|
73
|
+
? settings.versions.map((v) => ({
|
|
74
|
+
slug: v.slug,
|
|
75
|
+
label: v.label ?? v.slug,
|
|
76
|
+
docsHref: withBase(`/${locale}/v/${v.slug}/docs/getting-started/`),
|
|
77
|
+
banner: v.banner as "unmaintained" | "unreleased" | undefined,
|
|
78
|
+
}))
|
|
79
|
+
: [];
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<DocLayoutWithDefaults
|
|
83
|
+
title={composeMetaTitle(pageTitle)}
|
|
84
|
+
head={<HeadWithDefaults title={pageTitle} />}
|
|
85
|
+
lang={locale}
|
|
86
|
+
noindex={settings.noindex}
|
|
87
|
+
hideSidebar={true}
|
|
88
|
+
hideToc={true}
|
|
89
|
+
headerOverride={<HeaderWithDefaults lang={locale} currentPath={withBase(`/${locale}/docs/versions`)} />}
|
|
90
|
+
footerOverride={<FooterWithDefaults lang={locale} />}
|
|
91
|
+
bodyEndComponents={<BodyEndIslands basePath={settings.base ?? "/"} />}
|
|
92
|
+
>
|
|
93
|
+
<VersionsPageContent
|
|
94
|
+
latestHref={latestHref}
|
|
95
|
+
versions={versions}
|
|
96
|
+
labels={labels}
|
|
97
|
+
/>
|
|
98
|
+
</DocLayoutWithDefaults>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** @jsxRuntime automatic */
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
// Port of src/pages/docs/versions.astro → zfb page module.
|
|
4
|
+
//
|
|
5
|
+
// Default-locale (EN) documentation versions page. Static route — no
|
|
6
|
+
// paths() export needed. Lists the latest version and any past versions
|
|
7
|
+
// configured in settings.versions.
|
|
8
|
+
//
|
|
9
|
+
// Data flow:
|
|
10
|
+
// settings.versions → build version entry list
|
|
11
|
+
// t() for locale strings → labels bag passed to VersionsPageContent
|
|
12
|
+
|
|
13
|
+
import { settings } from "@/config/settings";
|
|
14
|
+
import { defaultLocale, t } from "@/config/i18n";
|
|
15
|
+
import { withBase } from "@/utils/base";
|
|
16
|
+
import { DocLayoutWithDefaults } from "@takazudo/zudo-doc/doclayout";
|
|
17
|
+
import { VersionsPageContent } from "@takazudo/zudo-doc/nav-indexing";
|
|
18
|
+
import type { VersionPageEntry, VersionsPageLabels } from "@takazudo/zudo-doc/nav-indexing";
|
|
19
|
+
import type { JSX } from "preact";
|
|
20
|
+
import { FooterWithDefaults } from "../lib/_footer-with-defaults";
|
|
21
|
+
import { HeaderWithDefaults } from "../lib/_header-with-defaults";
|
|
22
|
+
import { HeadWithDefaults } from "../lib/_head-with-defaults";
|
|
23
|
+
import { composeMetaTitle } from "../lib/_compose-meta-title";
|
|
24
|
+
import { BodyEndIslands } from "../lib/_body-end-islands";
|
|
25
|
+
|
|
26
|
+
export const frontmatter = { title: "Versions" };
|
|
27
|
+
|
|
28
|
+
export default function VersionsPage(): JSX.Element {
|
|
29
|
+
const locale = defaultLocale;
|
|
30
|
+
const pageTitle = t("version.page.title", locale);
|
|
31
|
+
|
|
32
|
+
const labels: VersionsPageLabels = {
|
|
33
|
+
pageTitle,
|
|
34
|
+
latestTitle: t("version.page.latest.title", locale),
|
|
35
|
+
latestDescription: t("version.page.latest.description", locale),
|
|
36
|
+
latestLink: t("version.page.latest.link", locale),
|
|
37
|
+
pastTitle: t("version.page.past.title", locale),
|
|
38
|
+
pastDescription: t("version.page.past.description", locale),
|
|
39
|
+
unmaintained: t("version.page.unmaintained", locale),
|
|
40
|
+
unreleased: t("version.page.unreleased", locale),
|
|
41
|
+
versionCol: t("version.switcher.label", locale),
|
|
42
|
+
statusCol: t("version.page.status", locale),
|
|
43
|
+
docsCol: t("version.page.docs", locale),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// Latest docs href — points to the default docs entry point
|
|
47
|
+
const latestHref = withBase("/docs/getting-started");
|
|
48
|
+
|
|
49
|
+
// Past version entries from settings
|
|
50
|
+
const versions: VersionPageEntry[] = settings.versions
|
|
51
|
+
? settings.versions.map((v) => ({
|
|
52
|
+
slug: v.slug,
|
|
53
|
+
label: v.label ?? v.slug,
|
|
54
|
+
docsHref: withBase(`/v/${v.slug}/docs/getting-started/`),
|
|
55
|
+
banner: v.banner as "unmaintained" | "unreleased" | undefined,
|
|
56
|
+
}))
|
|
57
|
+
: [];
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<DocLayoutWithDefaults
|
|
61
|
+
title={composeMetaTitle(pageTitle)}
|
|
62
|
+
head={<HeadWithDefaults title={pageTitle} />}
|
|
63
|
+
lang={locale}
|
|
64
|
+
noindex={settings.noindex}
|
|
65
|
+
hideSidebar={true}
|
|
66
|
+
hideToc={true}
|
|
67
|
+
headerOverride={<HeaderWithDefaults lang={locale} currentPath={withBase("/docs/versions")} />}
|
|
68
|
+
footerOverride={<FooterWithDefaults lang={locale} />}
|
|
69
|
+
bodyEndComponents={<BodyEndIslands basePath={settings.base ?? "/"} />}
|
|
70
|
+
>
|
|
71
|
+
<VersionsPageContent
|
|
72
|
+
latestHref={latestHref}
|
|
73
|
+
versions={versions}
|
|
74
|
+
labels={labels}
|
|
75
|
+
/>
|
|
76
|
+
</DocLayoutWithDefaults>
|
|
77
|
+
);
|
|
78
|
+
}
|