create-docus 4.0.0-beta.8 → 4.0.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.
Files changed (3) hide show
  1. package/README.md +47 -0
  2. package/dist/main.mjs +14 -3
  3. package/package.json +5 -7
package/README.md CHANGED
@@ -16,6 +16,9 @@ Create a new documentation project in seconds:
16
16
  # Create a new project
17
17
  npx create docus my-docs
18
18
 
19
+ # Or create with i18n template for multi-language docs
20
+ npx create docus my-docs -t i18n
21
+
19
22
  # Navigate to your project
20
23
  cd my-docs
21
24
 
@@ -25,6 +28,24 @@ npm run dev
25
28
 
26
29
  That's it! Your documentation site will be running at `http://localhost:3000`
27
30
 
31
+ ## 🌍 Templates
32
+
33
+ ### Default Template
34
+ Creates a basic documentation project ready for single-language content.
35
+
36
+ ### I18n Template
37
+ Use the `-t i18n` flag to create a project with internationalization support:
38
+
39
+ ```bash
40
+ npx create docus my-docs -t i18n
41
+ ```
42
+
43
+ The i18n template includes:
44
+ - Pre-configured `@nuxtjs/i18n` module
45
+ - Locale-based content structure (`content/en/`, `content/fr/`)
46
+ - Built-in language switcher
47
+ - Automatic URL prefixing (`/en/docs`, `/fr/docs`)
48
+
28
49
  ## 🎯 What it creates
29
50
 
30
51
  The CLI scaffolds a complete documentation project with:
@@ -32,6 +53,7 @@ The CLI scaffolds a complete documentation project with:
32
53
  - ✨ **Beautiful Design** - Clean, modern documentation theme
33
54
  - 📱 **Responsive** - Mobile-first responsive design
34
55
  - 🌙 **Dark Mode** - Built-in dark/light mode support
56
+ - 🌍 **Internationalization** - Native i18n support for multi-language docs
35
57
  - 🔍 **Search** - Full-text search functionality
36
58
  - 📝 **Markdown Enhanced** - Extended markdown with custom components
37
59
  - 🎨 **Customizable** - Easy theming and brand customization
@@ -66,6 +88,31 @@ my-docs/
66
88
  └── server/ # Server-side code (add your own server-side code)
67
89
  ```
68
90
 
91
+ ### `/content` folder structure
92
+
93
+ **Single language structure:**
94
+ ```
95
+ content/
96
+ ├── index.md
97
+ ├── getting-started.md
98
+ └── guide/
99
+ ├── introduction.md
100
+ └── configuration.md
101
+ ```
102
+
103
+ **Multi-language structure (with i18n):**
104
+ ```
105
+ content/
106
+ ├── en/
107
+ │ ├── index.md
108
+ │ └── guide/
109
+ │ └── introduction.md
110
+ └── fr/
111
+ ├── index.md
112
+ └── guide/
113
+ └── introduction.md
114
+ ```
115
+
69
116
  ## ⚡ Built with
70
117
 
71
118
  Your project comes pre-configured with the best of the Nuxt ecosystem:
package/dist/main.mjs CHANGED
@@ -15,12 +15,23 @@ function createCLI(opts) {
15
15
  description: "Project directory",
16
16
  required: false,
17
17
  default: "docs"
18
+ },
19
+ template: {
20
+ type: "string",
21
+ alias: "t",
22
+ description: "Template to use (default, i18n)",
23
+ required: false,
24
+ default: "default"
18
25
  }
19
26
  },
20
- async setup({ args }) {
21
- const dir = resolve(args.dir);
27
+ async setup(context) {
28
+ const dir = resolve(context.args.dir);
29
+ const template = context.args.template;
30
+ if (!["i18n", "default"].includes(template)) {
31
+ throw new Error("Invalid template");
32
+ }
22
33
  const { runCommand } = await import("nuxi");
23
- await runCommand("init", [dir, "-t", "gh:nuxtlabs/docus/.starters/default"]);
34
+ await runCommand("init", [dir, "-t", `gh:nuxtlabs/docus/.starters/${template}`]);
24
35
  }
25
36
  });
26
37
  return {
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "create-docus",
3
3
  "description": "CLI for creating Docus documentation projects",
4
+ "version": "4.0.0",
4
5
  "repository": {
5
6
  "type": "git",
6
7
  "url": "git+https://github.com/nuxtlabs/docus.git"
7
8
  },
8
9
  "private": false,
9
- "version": "4.0.0-beta.8",
10
- "keywords": [],
11
10
  "license": "MIT",
12
11
  "bin": {
13
12
  "create-docus": "dist/main.mjs"
@@ -21,19 +20,18 @@
21
20
  "dev": "tsx ./main.ts"
22
21
  },
23
22
  "dependencies": {
24
- "@nuxt/kit": "^4.0.0",
23
+ "@nuxt/kit": "^4.0.1",
25
24
  "c12": "^3.1.0",
26
25
  "citty": "^0.1.6",
27
26
  "defu": "^6.1.4",
28
27
  "dotenv": "^17.2.0",
29
- "nuxi": "^3.26.2",
28
+ "nuxi": "^3.26.4",
30
29
  "scule": "^1.3.0",
31
30
  "ufo": "^1.6.1",
32
- "unctx": "^2.4.1",
33
- "unist-util-visit": "^5.0.0"
31
+ "unctx": "^2.4.1"
34
32
  },
35
33
  "devDependencies": {
36
- "@types/node": "^24.0.14",
34
+ "@types/node": "^24.1.0",
37
35
  "tsup": "^8.5.0",
38
36
  "tsx": "^4.20.3"
39
37
  },