create-zudo-doc 0.2.13 → 0.2.15
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/dist/cli.d.ts +1 -0
- package/dist/constants.js +7 -0
- package/dist/scaffold.js +113 -11
- package/dist/settings-gen.js +8 -1
- package/package.json +1 -1
- package/templates/base/pages/robots.txt.tsx +29 -0
- package/templates/base/src/styles/global.css +7 -1
package/dist/cli.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -234,6 +234,13 @@ export const FEATURES = [
|
|
|
234
234
|
default: false,
|
|
235
235
|
cliFlag: "footer-taglist",
|
|
236
236
|
},
|
|
237
|
+
{
|
|
238
|
+
value: "noindex",
|
|
239
|
+
label: "Avoid robots indexing",
|
|
240
|
+
hint: "Keep search engines out (noindex meta + robots.txt)",
|
|
241
|
+
default: false,
|
|
242
|
+
cliFlag: "noindex",
|
|
243
|
+
},
|
|
237
244
|
];
|
|
238
245
|
// Display labels for header-right items. Keys are canonical component/trigger
|
|
239
246
|
// names from HeaderRightComponentName / HeaderRightTriggerName
|
package/dist/scaffold.js
CHANGED
|
@@ -39,26 +39,110 @@ function shouldCopyBaseFile(srcAbs, baseDir) {
|
|
|
39
39
|
return true;
|
|
40
40
|
}
|
|
41
41
|
const STARTER_CONTENT_EN = (siteName) => `---
|
|
42
|
-
title:
|
|
42
|
+
title: Getting Started
|
|
43
43
|
sidebar_position: 1
|
|
44
44
|
---
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Welcome to ${siteName}. Choose a topic below to get started.
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
<CategoryNav category="getting-started" />
|
|
49
|
+
`;
|
|
50
|
+
const STARTER_CONTENT_JA = () => `---
|
|
51
|
+
title: はじめに
|
|
52
|
+
sidebar_position: 1
|
|
53
|
+
---
|
|
49
54
|
|
|
50
|
-
|
|
55
|
+
ドキュメントへようこそ。以下のトピックから始めてください。
|
|
51
56
|
|
|
52
|
-
|
|
57
|
+
<CategoryNav category="getting-started" />
|
|
53
58
|
`;
|
|
54
|
-
const
|
|
55
|
-
title:
|
|
59
|
+
const STARTER_CHILD_INTRODUCTION_EN = (siteName) => `---
|
|
60
|
+
title: Introduction
|
|
56
61
|
sidebar_position: 1
|
|
57
62
|
---
|
|
58
63
|
|
|
59
|
-
|
|
64
|
+
## What is ${siteName}?
|
|
65
|
+
|
|
66
|
+
${siteName} is a documentation site built with [zudo-doc](https://github.com/zudolab/zudo-doc), a minimal documentation framework powered by zfb, MDX, and Tailwind CSS.
|
|
67
|
+
|
|
68
|
+
## Key Features
|
|
69
|
+
|
|
70
|
+
- MDX authoring with rich component support
|
|
71
|
+
- Fast static site generation via zfb
|
|
72
|
+
- Tailwind CSS v4 for styling
|
|
73
|
+
- Optional i18n, search, and more
|
|
74
|
+
`;
|
|
75
|
+
const STARTER_CHILD_INTRODUCTION_JA = (siteName) => `---
|
|
76
|
+
title: はじめに
|
|
77
|
+
sidebar_position: 1
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## ${siteName} とは?
|
|
81
|
+
|
|
82
|
+
${siteName} は [zudo-doc](https://github.com/zudolab/zudo-doc) で構築されたドキュメントサイトです。zfb・MDX・Tailwind CSS を使ったミニマルなドキュメントフレームワークです。
|
|
83
|
+
|
|
84
|
+
## 主な機能
|
|
85
|
+
|
|
86
|
+
- MDX によるリッチなコンポーネントサポート
|
|
87
|
+
- zfb による高速な静的サイト生成
|
|
88
|
+
- スタイリングには Tailwind CSS v4
|
|
89
|
+
- i18n・検索などオプション機能も充実
|
|
90
|
+
`;
|
|
91
|
+
const STARTER_CHILD_INSTALLATION_EN = () => `---
|
|
92
|
+
title: Installation
|
|
93
|
+
sidebar_position: 2
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Requirements
|
|
97
|
+
|
|
98
|
+
- Node.js 18 or later
|
|
99
|
+
- pnpm (recommended), npm, yarn, or bun
|
|
100
|
+
|
|
101
|
+
## Create a New Project
|
|
102
|
+
|
|
103
|
+
Run the scaffolding tool to create a new project:
|
|
104
|
+
|
|
105
|
+
\`\`\`sh
|
|
106
|
+
pnpm create zudo-doc my-docs
|
|
107
|
+
\`\`\`
|
|
108
|
+
|
|
109
|
+
## Start the Dev Server
|
|
110
|
+
|
|
111
|
+
\`\`\`sh
|
|
112
|
+
cd my-docs
|
|
113
|
+
pnpm install
|
|
114
|
+
pnpm dev
|
|
115
|
+
\`\`\`
|
|
116
|
+
|
|
117
|
+
Open [http://localhost:4321](http://localhost:4321) to view your docs.
|
|
118
|
+
`;
|
|
119
|
+
const STARTER_CHILD_INSTALLATION_JA = () => `---
|
|
120
|
+
title: インストール
|
|
121
|
+
sidebar_position: 2
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 動作要件
|
|
125
|
+
|
|
126
|
+
- Node.js 18 以降
|
|
127
|
+
- pnpm(推奨)、npm、yarn、または bun
|
|
128
|
+
|
|
129
|
+
## 新しいプロジェクトを作成する
|
|
130
|
+
|
|
131
|
+
スキャフォールドツールを実行して新しいプロジェクトを作成します:
|
|
132
|
+
|
|
133
|
+
\`\`\`sh
|
|
134
|
+
pnpm create zudo-doc my-docs
|
|
135
|
+
\`\`\`
|
|
136
|
+
|
|
137
|
+
## 開発サーバーを起動する
|
|
138
|
+
|
|
139
|
+
\`\`\`sh
|
|
140
|
+
cd my-docs
|
|
141
|
+
pnpm install
|
|
142
|
+
pnpm dev
|
|
143
|
+
\`\`\`
|
|
60
144
|
|
|
61
|
-
|
|
145
|
+
[http://localhost:4321](http://localhost:4321) を開いてドキュメントを確認してください。
|
|
62
146
|
`;
|
|
63
147
|
const CHANGELOG_CONTENT_EN = () => `---
|
|
64
148
|
title: Changelog
|
|
@@ -149,6 +233,15 @@ export async function scaffold(choices) {
|
|
|
149
233
|
? STARTER_CONTENT_JA()
|
|
150
234
|
: STARTER_CONTENT_EN(escapedName);
|
|
151
235
|
await fs.outputFile(path.join(targetDir, "src/content/docs/getting-started/index.mdx"), primaryContent);
|
|
236
|
+
// Primary language child docs under getting-started/
|
|
237
|
+
const primaryIntroductionContent = defaultLang === "ja"
|
|
238
|
+
? STARTER_CHILD_INTRODUCTION_JA(escapedName)
|
|
239
|
+
: STARTER_CHILD_INTRODUCTION_EN(escapedName);
|
|
240
|
+
await fs.outputFile(path.join(targetDir, "src/content/docs/getting-started/introduction.mdx"), primaryIntroductionContent);
|
|
241
|
+
const primaryInstallationContent = defaultLang === "ja"
|
|
242
|
+
? STARTER_CHILD_INSTALLATION_JA()
|
|
243
|
+
: STARTER_CHILD_INSTALLATION_EN();
|
|
244
|
+
await fs.outputFile(path.join(targetDir, "src/content/docs/getting-started/installation.mdx"), primaryInstallationContent);
|
|
152
245
|
// When i18n is ON, place secondary language content
|
|
153
246
|
if (choices.features.includes("i18n")) {
|
|
154
247
|
const secondaryLang = getSecondaryLang(defaultLang);
|
|
@@ -158,6 +251,15 @@ export async function scaffold(choices) {
|
|
|
158
251
|
? STARTER_CONTENT_JA()
|
|
159
252
|
: STARTER_CONTENT_EN(escapedName);
|
|
160
253
|
await fs.outputFile(path.join(targetDir, `${secondaryDir}/getting-started/index.mdx`), secondaryContent);
|
|
254
|
+
// Secondary language child docs under getting-started/
|
|
255
|
+
const secondaryIntroductionContent = secondaryLang === "ja"
|
|
256
|
+
? STARTER_CHILD_INTRODUCTION_JA(escapedName)
|
|
257
|
+
: STARTER_CHILD_INTRODUCTION_EN(escapedName);
|
|
258
|
+
await fs.outputFile(path.join(targetDir, `${secondaryDir}/getting-started/introduction.mdx`), secondaryIntroductionContent);
|
|
259
|
+
const secondaryInstallationContent = secondaryLang === "ja"
|
|
260
|
+
? STARTER_CHILD_INSTALLATION_JA()
|
|
261
|
+
: STARTER_CHILD_INSTALLATION_EN();
|
|
262
|
+
await fs.outputFile(path.join(targetDir, `${secondaryDir}/getting-started/installation.mdx`), secondaryInstallationContent);
|
|
161
263
|
}
|
|
162
264
|
// When changelog is ON, create a starter changelog page
|
|
163
265
|
if (choices.features.includes("changelog")) {
|
|
@@ -357,7 +459,7 @@ function generatePackageJson(choices) {
|
|
|
357
459
|
// ties this pin to packages/zudo-doc's version, so the lockstep release
|
|
358
460
|
// bumps both together; do not cut a create-zudo-doc release until the
|
|
359
461
|
// matching @takazudo/zudo-doc version (with content.css) is on npm.
|
|
360
|
-
"@takazudo/zudo-doc": "^0.2.
|
|
462
|
+
"@takazudo/zudo-doc": "^0.2.15",
|
|
361
463
|
// zod — used by the generated zfb.config.ts. zfb-config-gen emits
|
|
362
464
|
// `import { z } from "zod"` for the content-collection schema +
|
|
363
465
|
// `z.toJSONSchema(...)` conversion. Without this dep, the consumer
|
|
@@ -411,7 +513,7 @@ function generatePackageJson(choices) {
|
|
|
411
513
|
// @takazudo/zudo-doc/integrations/doc-history which in turn imports
|
|
412
514
|
// @takazudo/zudo-doc-history-server/git-history. Without this dep the
|
|
413
515
|
// plugin host fails at init with ERR_MODULE_NOT_FOUND — W8A (#1739).
|
|
414
|
-
deps["@takazudo/zudo-doc-history-server"] = "^0.2.
|
|
516
|
+
deps["@takazudo/zudo-doc-history-server"] = "^0.2.15";
|
|
415
517
|
// W7A (#1736): doc-history-plugin.mjs spawns `tsx -e <inline-script>` to
|
|
416
518
|
// run the v2 runtime in a TS-aware Node subprocess; without tsx the
|
|
417
519
|
// plugin's preBuild step exits with ENOENT before zfb finishes config
|
package/dist/settings-gen.js
CHANGED
|
@@ -51,7 +51,7 @@ export function generateSettingsFile(choices) {
|
|
|
51
51
|
lines.push(` siteDescription: "" as string,`);
|
|
52
52
|
lines.push(` base: "/",`);
|
|
53
53
|
lines.push(` trailingSlash: false as boolean,`);
|
|
54
|
-
lines.push(` noindex:
|
|
54
|
+
lines.push(` noindex: ${choices.features.includes("noindex")} as boolean,`);
|
|
55
55
|
lines.push(` editUrl: false as string | false,`);
|
|
56
56
|
const rawGithubUrl = (choices.githubUrl ?? "").trim();
|
|
57
57
|
if (rawGithubUrl) {
|
|
@@ -251,6 +251,13 @@ export function generateSettingsFile(choices) {
|
|
|
251
251
|
}
|
|
252
252
|
lines.push(` headerNav: [`);
|
|
253
253
|
lines.push(` { label: "Getting Started", path: "/docs/getting-started", categoryMatch: "getting-started" },`);
|
|
254
|
+
// The "claude" categoryMatch is load-bearing beyond the header link: getCategoryOrder()
|
|
255
|
+
// derives the satellite-grouping prefixes from headerNav, so without this entry
|
|
256
|
+
// groupSatelliteNodes() never nests claude-md/claude-skills/... under the "claude"
|
|
257
|
+
// overview node and they spread out as separate top-level cards on the index sitemap.
|
|
258
|
+
if (choices.features.includes("claudeResources")) {
|
|
259
|
+
lines.push(` { label: "Claude", path: "/docs/claude", categoryMatch: "claude" },`);
|
|
260
|
+
}
|
|
254
261
|
if (choices.features.includes("changelog")) {
|
|
255
262
|
lines.push(` { label: "Changelog", path: "/docs/changelog", categoryMatch: "changelog" },`);
|
|
256
263
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Prerendered robots.txt page route, gated by settings.noindex.
|
|
2
|
+
//
|
|
3
|
+
// Filename → output extension mapping (zfb convention): the
|
|
4
|
+
// second-to-last `.`-separated segment of the stem becomes the output
|
|
5
|
+
// extension, so `robots.txt.tsx` builds `dist/robots.txt`. The
|
|
6
|
+
// explicit `contentType` export pins the dev-server Content-Type
|
|
7
|
+
// header to `text/plain` regardless of the filename hint.
|
|
8
|
+
|
|
9
|
+
import { settings } from "@/config/settings";
|
|
10
|
+
|
|
11
|
+
export const frontmatter = { title: "Robots" };
|
|
12
|
+
export const contentType = "text/plain";
|
|
13
|
+
|
|
14
|
+
export default function Robots(): string {
|
|
15
|
+
if (settings.noindex) {
|
|
16
|
+
// noindex: disallow all crawlers. Omit Sitemap: — advertising a sitemap
|
|
17
|
+
// while disallowing all crawlers is contradictory.
|
|
18
|
+
return `User-agent: *\nDisallow: /\n`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const siteUrlBase = (settings.siteUrl ?? "").replace(/\/$/, "");
|
|
22
|
+
const hasSitemapLine = siteUrlBase !== "" && settings.sitemap;
|
|
23
|
+
|
|
24
|
+
const sitemapLine = hasSitemapLine
|
|
25
|
+
? `Sitemap: ${siteUrlBase}/sitemap.xml\n`
|
|
26
|
+
: "";
|
|
27
|
+
|
|
28
|
+
return `User-agent: *\nAllow: /\n${sitemapLine}`;
|
|
29
|
+
}
|
|
@@ -640,10 +640,16 @@ pre[class^="syntect-"] .line .highlighted-word {
|
|
|
640
640
|
* transition settles immediately — no cross-fade, no translateY slide.
|
|
641
641
|
* Covers the root cross-fade and the #2072 :only-child entry/exit rules;
|
|
642
642
|
* the both-sides chrome layers are already animation: none above. Equal
|
|
643
|
-
* specificity per selector, but later in source order, so these win.
|
|
643
|
+
* specificity per selector, but later in source order, so these win.
|
|
644
|
+
* ::view-transition-group(root) must be neutralized too (zudolab/zzmod#845):
|
|
645
|
+
* the UA animates the root group for its full duration even when the old/new
|
|
646
|
+
* root snapshots are at animation: none, leaving a brief frozen,
|
|
647
|
+
* non-interactive frame. The chrome groups are already animation: none in the
|
|
648
|
+
* unconditional chrome block above, so only the root group is added here. */
|
|
644
649
|
@media (prefers-reduced-motion: reduce) {
|
|
645
650
|
::view-transition-old(root),
|
|
646
651
|
::view-transition-new(root),
|
|
652
|
+
::view-transition-group(root),
|
|
647
653
|
::view-transition-old(zfb-header):only-child,
|
|
648
654
|
::view-transition-old(zfb-sidebar):only-child,
|
|
649
655
|
::view-transition-old(zfb-footer):only-child,
|