create-zudo-doc 0.2.12 → 0.2.14
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
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")) {
|
|
@@ -333,16 +435,19 @@ function generatePackageJson(choices) {
|
|
|
333
435
|
// "@takazudo/zfb" (#972) — plus removal of the no-op linkValidation.allowExternal
|
|
334
436
|
// knob (#925); both are non-breaking for a fresh scaffold. A fresh scaffold
|
|
335
437
|
// sets no explicit codeHighlight.theme so the default still applies. No
|
|
336
|
-
// consumer-facing / CLI breaking change. next.52
|
|
438
|
+
// consumer-facing / CLI breaking change. next.52: adds the
|
|
337
439
|
// `ClientRouter({ preserveHtmlAttrs })` option (zfb#1104) — consumers can
|
|
338
440
|
// declare runtime `<html>` attribute names to preserve across SPA swaps so
|
|
339
441
|
// e.g. `data-sidebar-hidden` / `data-theme` survive (zudolab/zudo-doc#2200).
|
|
340
|
-
// Additive, non-breaking for a fresh scaffold.
|
|
341
|
-
|
|
342
|
-
|
|
442
|
+
// Additive, non-breaking for a fresh scaffold. next.53 (current pin):
|
|
443
|
+
// zfb-content GFM-autolink fix — terminate the autolink path at CJK
|
|
444
|
+
// boundaries (zfb#1105). Content-rendering bug fix, additive; relevant for
|
|
445
|
+
// CJK (e.g. Japanese) docs. No consumer-facing / CLI breaking change.
|
|
446
|
+
"@takazudo/zfb": "0.1.0-next.53",
|
|
447
|
+
"@takazudo/zfb-runtime": "0.1.0-next.53",
|
|
343
448
|
// zfb-adapter-cloudflare — required for any route with `prerender = false`.
|
|
344
449
|
// Pinned in lockstep with @takazudo/zfb.
|
|
345
|
-
"@takazudo/zfb-adapter-cloudflare": "0.1.0-next.
|
|
450
|
+
"@takazudo/zfb-adapter-cloudflare": "0.1.0-next.53",
|
|
346
451
|
// @takazudo/zudo-doc — published from this monorepo via
|
|
347
452
|
// .github/workflows/publish-zudo-doc.yml. The pin here is bumped in
|
|
348
453
|
// lockstep by scripts/release-create-zudo-doc.sh whenever zudo-doc's
|
|
@@ -354,7 +459,7 @@ function generatePackageJson(choices) {
|
|
|
354
459
|
// ties this pin to packages/zudo-doc's version, so the lockstep release
|
|
355
460
|
// bumps both together; do not cut a create-zudo-doc release until the
|
|
356
461
|
// matching @takazudo/zudo-doc version (with content.css) is on npm.
|
|
357
|
-
"@takazudo/zudo-doc": "^0.2.
|
|
462
|
+
"@takazudo/zudo-doc": "^0.2.14",
|
|
358
463
|
// zod — used by the generated zfb.config.ts. zfb-config-gen emits
|
|
359
464
|
// `import { z } from "zod"` for the content-collection schema +
|
|
360
465
|
// `z.toJSONSchema(...)` conversion. Without this dep, the consumer
|
|
@@ -408,7 +513,7 @@ function generatePackageJson(choices) {
|
|
|
408
513
|
// @takazudo/zudo-doc/integrations/doc-history which in turn imports
|
|
409
514
|
// @takazudo/zudo-doc-history-server/git-history. Without this dep the
|
|
410
515
|
// plugin host fails at init with ERR_MODULE_NOT_FOUND — W8A (#1739).
|
|
411
|
-
deps["@takazudo/zudo-doc-history-server"] = "^0.2.
|
|
516
|
+
deps["@takazudo/zudo-doc-history-server"] = "^0.2.14";
|
|
412
517
|
// W7A (#1736): doc-history-plugin.mjs spawns `tsx -e <inline-script>` to
|
|
413
518
|
// run the v2 runtime in a TS-aware Node subprocess; without tsx the
|
|
414
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) {
|
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
|
+
}
|