create-boltdocs 0.1.0 → 0.2.1
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/index.cjs +120 -728
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +114 -0
- package/dist/templates/base/boltdocs.config.ts +35 -0
- package/dist/templates/base/docs/getting-started/index.md +33 -0
- package/dist/templates/base/docs/layout.tsx +78 -0
- package/dist/templates/base/docs/pages-external/index.tsx +23 -0
- package/dist/templates/base/index.css +12 -0
- package/dist/templates/base/index.html +11 -0
- package/dist/templates/base/package.json +25 -0
- package/dist/templates/base/public/dark.svg +4 -0
- package/dist/templates/base/public/light.svg +4 -0
- package/dist/templates/base/src/components/footer.tsx +7 -0
- package/dist/templates/base/src/pages/home.tsx +43 -0
- package/dist/templates/base/tsconfig.json +22 -0
- package/dist/templates/base/tsconfig.node.json +10 -0
- package/dist/templates/i18n/boltdocs.config.ts +39 -0
- package/dist/templates/i18n/docs/es/getting-started/index.md +33 -0
- package/dist/templates/i18n/docs/getting-started/index.md +33 -0
- package/dist/templates/i18n/docs/layout.tsx +80 -0
- package/dist/templates/i18n/docs/pages-external/index.tsx +23 -0
- package/dist/templates/i18n/index.css +12 -0
- package/dist/templates/i18n/index.html +11 -0
- package/dist/templates/i18n/package.json +25 -0
- package/dist/templates/i18n/public/dark.svg +4 -0
- package/dist/templates/i18n/public/light.svg +4 -0
- package/dist/templates/i18n/src/components/footer.tsx +15 -0
- package/dist/templates/i18n/src/pages/home.tsx +43 -0
- package/dist/templates/i18n/tsconfig.json +22 -0
- package/dist/templates/i18n/tsconfig.node.json +10 -0
- package/package.json +6 -6
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -724
package/dist/index.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { execSync } from "node:child_process";
|
|
6
|
+
import prompts from "prompts";
|
|
7
|
+
import picocolors from "picocolors";
|
|
8
|
+
//#region src/index.ts
|
|
9
|
+
const { green, yellow, bold, cyan, magenta, blue, red, dim } = picocolors;
|
|
10
|
+
function getPackageManager() {
|
|
11
|
+
const userAgent = process.env.npm_config_user_agent;
|
|
12
|
+
if (userAgent?.includes("pnpm")) return "pnpm";
|
|
13
|
+
if (userAgent?.includes("yarn")) return "yarn";
|
|
14
|
+
if (userAgent?.includes("bun")) return "bun";
|
|
15
|
+
return "npm";
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Recursively copies a directory and replaces placeholders in text files.
|
|
19
|
+
*/
|
|
20
|
+
function copy(src, dest, replacements) {
|
|
21
|
+
if (fs.statSync(src).isDirectory()) {
|
|
22
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
23
|
+
for (const file of fs.readdirSync(src)) copy(path.resolve(src, file), path.resolve(dest, file), replacements);
|
|
24
|
+
} else if (!/\.(png|jpg|jpeg|gif|webp|ico|pdf|zip|gz)$/i.test(src)) {
|
|
25
|
+
let content = fs.readFileSync(src, "utf-8");
|
|
26
|
+
for (const [key, value] of Object.entries(replacements)) content = content.replace(new RegExp(`{{${key}}}`, "g"), value);
|
|
27
|
+
fs.writeFileSync(dest, content);
|
|
28
|
+
} else fs.copyFileSync(src, dest);
|
|
29
|
+
}
|
|
30
|
+
async function run() {
|
|
31
|
+
const pkgManager = getPackageManager();
|
|
32
|
+
console.log(blue(bold(`
|
|
33
|
+
____ ___ _ _____ ____ ___ ____ ____
|
|
34
|
+
| __ ) / _ \\| | |_ _| _ \\ / _ \\ / ___/ ___|
|
|
35
|
+
| _ \\| | | | | | | | | | | | | | | \\___ \\
|
|
36
|
+
| |_) | |_| | |___ | | | |_| | |_| | |___ ___) |
|
|
37
|
+
|____/ \\___/|_____| |_| |____/ \\___/ \\____|____/`)));
|
|
38
|
+
console.log(dim(`\n v0.0.4 - The modern documentation framework\n`));
|
|
39
|
+
const response = await prompts([
|
|
40
|
+
{
|
|
41
|
+
type: "text",
|
|
42
|
+
name: "projectName",
|
|
43
|
+
message: "Project name:",
|
|
44
|
+
initial: "my-boltdocs-app"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: "select",
|
|
48
|
+
name: "template",
|
|
49
|
+
message: "Select a project preset:",
|
|
50
|
+
choices: [{
|
|
51
|
+
title: magenta("Base"),
|
|
52
|
+
description: "Hero and custom components.",
|
|
53
|
+
value: "base"
|
|
54
|
+
}, {
|
|
55
|
+
title: yellow("i18n"),
|
|
56
|
+
description: "Multi-language support (EN/ES).",
|
|
57
|
+
value: "i18n"
|
|
58
|
+
}],
|
|
59
|
+
initial: 0
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: "confirm",
|
|
63
|
+
name: "install",
|
|
64
|
+
message: `Install dependencies with ${bold(pkgManager)}?`,
|
|
65
|
+
initial: true
|
|
66
|
+
}
|
|
67
|
+
]);
|
|
68
|
+
if (!response.projectName || !response.template) {
|
|
69
|
+
console.log(yellow("\nOperation canceled."));
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const projectDir = path.join(process.cwd(), response.projectName);
|
|
73
|
+
if (fs.existsSync(projectDir)) {
|
|
74
|
+
console.error(red(`\nError: Directory "${response.projectName}" already exists.`));
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
console.log(dim(`\nBuilding your documentation site...\n`));
|
|
78
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
79
|
+
const templateDir = path.resolve(__dirname, "templates", response.template);
|
|
80
|
+
if (!fs.existsSync(templateDir)) {
|
|
81
|
+
console.error(red(`\nError: Template "${response.template}" not found at ${templateDir}`));
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
copy(templateDir, projectDir, {
|
|
86
|
+
name: response.projectName,
|
|
87
|
+
title: response.projectName
|
|
88
|
+
});
|
|
89
|
+
console.log(`${green("✔")} Created project structure and applied "${response.template}" preset`);
|
|
90
|
+
} catch (error) {
|
|
91
|
+
console.error(red(`\nError copying template: ${error instanceof Error ? error.message : String(error)}`));
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
if (response.install) {
|
|
95
|
+
console.log(cyan(`\nInstalling dependencies with ${pkgManager}...\n`));
|
|
96
|
+
try {
|
|
97
|
+
execSync(`${pkgManager} install`, {
|
|
98
|
+
cwd: projectDir,
|
|
99
|
+
stdio: "inherit"
|
|
100
|
+
});
|
|
101
|
+
console.log(`\n${green("✔")} Dependencies installed successfully`);
|
|
102
|
+
} catch (e) {
|
|
103
|
+
console.log(yellow(`\nCould not install dependencies automatically. Please run "${pkgManager} install".`));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
console.log(bold(green("\n✨ All set! Your documentation is ready. ✨\n")));
|
|
107
|
+
console.log(`To start developing:`);
|
|
108
|
+
console.log(` cd ${response.projectName}`);
|
|
109
|
+
if (!response.install) console.log(` ${pkgManager} install`);
|
|
110
|
+
console.log(` ${pkgManager} run dev\n`);
|
|
111
|
+
}
|
|
112
|
+
run().catch(console.error);
|
|
113
|
+
//#endregion
|
|
114
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineConfig } from 'boltdocs'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
siteUrl: 'https://my-docs.com/',
|
|
5
|
+
theme: {
|
|
6
|
+
title: '{{title}}',
|
|
7
|
+
description: 'Documentation for my project',
|
|
8
|
+
breadcrumbs: true,
|
|
9
|
+
codeTheme: {
|
|
10
|
+
light: 'github-light',
|
|
11
|
+
dark: 'github-dark',
|
|
12
|
+
},
|
|
13
|
+
favicon: '/light.svg',
|
|
14
|
+
logo: {
|
|
15
|
+
dark: '/light.svg',
|
|
16
|
+
light: '/dark.svg',
|
|
17
|
+
alt: 'Boltdocs Logo',
|
|
18
|
+
},
|
|
19
|
+
navbar: [
|
|
20
|
+
{
|
|
21
|
+
label: 'Docs',
|
|
22
|
+
href: '/docs/getting-started',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
// githubRepo: 'bolt-doc/boltdocs',
|
|
26
|
+
},
|
|
27
|
+
robots: {
|
|
28
|
+
rules: [
|
|
29
|
+
{
|
|
30
|
+
userAgent: '*',
|
|
31
|
+
allow: '/',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Getting Started
|
|
2
|
+
|
|
3
|
+
This is the base for your new **Boltdocs** project. Here you'll find everything you need to start writing and publishing your content.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
1. **Install dependencies**:
|
|
8
|
+
```bash
|
|
9
|
+
pnpm install
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
2. **Start development server**:
|
|
13
|
+
```bash
|
|
14
|
+
pnpm dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
3. **View results**: Open [http://localhost:5173](http://localhost:5173) in your browser.
|
|
18
|
+
|
|
19
|
+
## Writing Content
|
|
20
|
+
|
|
21
|
+
Boltdocs uses **Markdown** for content. Simply create `.md` files in the `docs/` folder and they will automatically appear on your site.
|
|
22
|
+
|
|
23
|
+
### Page Example:
|
|
24
|
+
|
|
25
|
+
```markdown
|
|
26
|
+
# My Title
|
|
27
|
+
|
|
28
|
+
This is an example paragraph. You can use **bold**, *italics*, and [links](https://google.com).
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Customization
|
|
32
|
+
|
|
33
|
+
You can modify the design and behavior in `boltdocs.config.ts`. For deeper changes, explore the `src/` folder.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DocsLayout,
|
|
3
|
+
Navbar,
|
|
4
|
+
Sidebar,
|
|
5
|
+
OnThisPage,
|
|
6
|
+
Head,
|
|
7
|
+
Breadcrumbs,
|
|
8
|
+
PageNav,
|
|
9
|
+
ErrorBoundary,
|
|
10
|
+
CopyMarkdown,
|
|
11
|
+
useRoutes,
|
|
12
|
+
useConfig,
|
|
13
|
+
useMdxComponents,
|
|
14
|
+
useLocation
|
|
15
|
+
} from 'boltdocs/client'
|
|
16
|
+
|
|
17
|
+
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
18
|
+
const {
|
|
19
|
+
routes: filteredRoutes,
|
|
20
|
+
allRoutes,
|
|
21
|
+
currentRoute
|
|
22
|
+
} = useRoutes()
|
|
23
|
+
const { pathname } = useLocation()
|
|
24
|
+
const config = useConfig()
|
|
25
|
+
const mdxComponents = useMdxComponents()
|
|
26
|
+
|
|
27
|
+
// Allow CopyMarkdown override via mdx-components.tsx
|
|
28
|
+
const CopyMarkdownComp = (mdxComponents.CopyMarkdown as any) || CopyMarkdown
|
|
29
|
+
|
|
30
|
+
const isDocs = pathname.startsWith('/docs')
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<DocsLayout>
|
|
34
|
+
<Head
|
|
35
|
+
siteTitle={config.theme?.title || 'Boltdocs'}
|
|
36
|
+
siteDescription={config.theme?.description || ''}
|
|
37
|
+
routes={allRoutes}
|
|
38
|
+
/>
|
|
39
|
+
<Navbar />
|
|
40
|
+
|
|
41
|
+
<DocsLayout.Body>
|
|
42
|
+
{isDocs && <Sidebar routes={filteredRoutes} config={config} />}
|
|
43
|
+
|
|
44
|
+
<DocsLayout.Content>
|
|
45
|
+
<DocsLayout.ContentMdx>
|
|
46
|
+
{isDocs && (
|
|
47
|
+
<DocsLayout.ContentHeader>
|
|
48
|
+
<Breadcrumbs />
|
|
49
|
+
<CopyMarkdownComp
|
|
50
|
+
mdxRaw={currentRoute?._rawContent}
|
|
51
|
+
route={currentRoute}
|
|
52
|
+
config={config.theme?.copyMarkdown}
|
|
53
|
+
/>
|
|
54
|
+
</DocsLayout.ContentHeader>
|
|
55
|
+
)}
|
|
56
|
+
|
|
57
|
+
<ErrorBoundary>{children}</ErrorBoundary>
|
|
58
|
+
|
|
59
|
+
{isDocs && (
|
|
60
|
+
<DocsLayout.ContentFooter>
|
|
61
|
+
<PageNav />
|
|
62
|
+
</DocsLayout.ContentFooter>
|
|
63
|
+
)}
|
|
64
|
+
</DocsLayout.ContentMdx>
|
|
65
|
+
</DocsLayout.Content>
|
|
66
|
+
|
|
67
|
+
{isDocs && (
|
|
68
|
+
<OnThisPage
|
|
69
|
+
headings={currentRoute?.headings}
|
|
70
|
+
editLink={config.theme?.editLink}
|
|
71
|
+
communityHelp={config.theme?.communityHelp}
|
|
72
|
+
filePath={currentRoute?.filePath}
|
|
73
|
+
/>
|
|
74
|
+
)}
|
|
75
|
+
</DocsLayout.Body>
|
|
76
|
+
</DocsLayout>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Navbar } from 'boltdocs/client';
|
|
2
|
+
import { Footer } from '../../src/components/footer';
|
|
3
|
+
import { HomePage } from '../../src/pages/home'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Custom home page for the site.
|
|
7
|
+
* This overrides any homePage set in boltdocs.config.ts.
|
|
8
|
+
*/
|
|
9
|
+
export const homePage = HomePage;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Custom external routes.
|
|
13
|
+
* Maps paths to React components.
|
|
14
|
+
*/
|
|
15
|
+
// export const pages = {
|
|
16
|
+
// pricing: PricingPage
|
|
17
|
+
// };
|
|
18
|
+
|
|
19
|
+
export const layout = ({ children }: { children: React.ReactNode }) => <div className='pb-10'>
|
|
20
|
+
<Navbar />
|
|
21
|
+
{children}
|
|
22
|
+
<Footer />
|
|
23
|
+
</div>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
|
|
2
|
+
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap");
|
|
3
|
+
|
|
4
|
+
@import "tailwindcss";
|
|
5
|
+
|
|
6
|
+
@import "boltdocs/theme/neutral.css";
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
@source directive tells Tailwind to scan Boltdocs client components
|
|
10
|
+
inside node_modules for class usage and generate the necessary CSS.
|
|
11
|
+
*/
|
|
12
|
+
@source "./node_modules/boltdocs/src/client";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "boltdocs",
|
|
8
|
+
"build": "boltdocs build",
|
|
9
|
+
"preview": "boltdocs preview",
|
|
10
|
+
"doctor": "boltdocs doctor"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"lucide-react": "^1.7.0",
|
|
14
|
+
"react": "^19.2.5",
|
|
15
|
+
"react-dom": "^19.2.5"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
19
|
+
"@types/react": "^19.1.0",
|
|
20
|
+
"@types/react-dom": "^19.1.0",
|
|
21
|
+
"boltdocs": "latest",
|
|
22
|
+
"tailwindcss": "^4.2.2",
|
|
23
|
+
"typescript": "^5.0.0"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="60" height="52" viewBox="0 0 60 52" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M29.4449 0H19.4449V16.5L29.4449 6.5V0Z" fill="black"/>
|
|
3
|
+
<path d="M26.9449 22.7265C26.9449 22.5077 21.2201 27.0658 16.9449 28.5C13.7491 29.5721 12.3156 29.5038 8.94486 29.5C5.59532 29.4963 0 28.5 0 28.5C0 28.5 5.57953 28.5146 8.94486 27.5C12.5409 26.4158 14.8203 25.5843 17.9449 23.5C23.3445 19.898 29.4449 11.5 29.4449 11.5L29.9449 18.5C29.9449 18.5 33.5124 15.5332 36.4449 15C41.9449 14 45.4449 15 45.4449 15C45.4449 15 36.9449 19 34.4449 21.5C31.5322 24.4126 29.8582 26.9017 29.4449 31C29.1217 34.2041 29.4771 36.4508 31.4449 39C33.5792 41.765 35.952 43.0183 39.4449 43C42.677 42.9831 45.3003 42.4182 47.4449 40C49.7406 37.4113 50.2495 34.4466 49.9449 31C49.6603 27.7804 48.4876 25.4953 45.9449 23.5C43.2931 21.4191 36.4449 24 36.4449 24L47.4449 15.5C47.4449 15.5 50.4449 16 53.4449 19C56.4449 22 57.4449 23.5 57.9449 24.5C58.4449 25.5 59.9449 28.5 59.9449 33.5C59.9449 36.4869 59.9449 37.5 57.9449 41.5C55.9449 45.5 52.9449 47.5 52.9449 47.5C52.9449 47.5 51.9449 48.5 49.9449 49.5C47.9449 50.5 45.9289 50.8863 44.9449 51.1121C43.2783 51.4944 42.7023 51.5 41.4449 51.5C40.6256 51.5 39.3731 51.3693 37.9449 51.0624C36.9972 50.8587 35.9722 50.5774 34.9449 50.2051C33.7409 49.7688 32.5339 49.2076 31.4449 48.5C30.6262 47.9681 29.4449 47 29.4449 47V51H19.4449V37.9904L22.9449 31.4226L26.9449 22.7265Z" fill="black"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="60" height="51" viewBox="0 0 60 51" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M29.4449 0H19.4449V16.5L29.4449 6.5V0Z" fill="white"/>
|
|
3
|
+
<path d="M26.9449 22.7265C26.9449 22.5077 21.2201 27.0658 16.9449 28.5C13.7491 29.5721 12.3156 29.5038 8.94486 29.5C5.59532 29.4963 0 28.5 0 28.5C0 28.5 5.57953 28.5146 8.94486 27.5C12.5409 26.4158 14.8203 25.5843 17.9449 23.5C23.3445 19.898 29.4449 11.5 29.4449 11.5L29.9449 18C29.9449 18 33.5825 15.8308 36.4449 15C39.4452 14.1291 44.4449 14 44.4449 14C44.4449 14 36.9449 19 34.4449 21.5C31.5322 24.4126 29.8582 26.9017 29.4449 31C29.1217 34.2041 29.4771 36.4508 31.4449 39C33.5792 41.765 35.952 43.0183 39.4449 43C42.677 42.9831 45.3003 42.4182 47.4449 40C49.7406 37.4113 50.2495 34.4466 49.9449 31C49.6603 27.7804 48.4876 25.4953 45.9449 23.5C43.2931 21.4191 36.4449 24 36.4449 24L47.9449 15C47.9449 15 51.5761 16.771 53.4449 18.5C55.711 20.5967 56.7467 22.1546 57.9449 25C59.1784 27.9295 59.4832 29.8216 59.4449 33C59.4089 35.9867 59.179 37.78 57.9449 40.5C56.8475 42.9185 55.8511 44.6507 53.9449 46.5C51.9236 48.4609 50.5803 49.0076 47.9449 50C45.5414 50.9051 44.0131 51 41.4449 51C38.8766 51 37.3235 50.9685 34.9449 50C32.4851 48.9985 29.4449 46 29.4449 46V51H19.4449V37.9904L22.9449 31.4226L26.9449 22.7265Z" fill="white"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Card, Cards } from 'boltdocs/client'
|
|
2
|
+
import { Route, FileText, Settings, Sparkles } from 'lucide-react'
|
|
3
|
+
|
|
4
|
+
const features = [
|
|
5
|
+
{
|
|
6
|
+
title: "File-route",
|
|
7
|
+
description: "Generate routes from file structure.",
|
|
8
|
+
Icon: Route
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
title: "Markdown",
|
|
12
|
+
description: "Support Markdown for writing documentation.",
|
|
13
|
+
Icon: FileText
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
title: "Customizable",
|
|
17
|
+
description: "Customizable to your needs.",
|
|
18
|
+
Icon: Settings
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
title: "Secure by design",
|
|
22
|
+
description: "Boltdocs is secure by design.",
|
|
23
|
+
Icon: Sparkles
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
export function HomePage() {
|
|
28
|
+
return (
|
|
29
|
+
<div className='w-full h-[calc(100vh-120px)] flex items-center gap-10'>
|
|
30
|
+
<div className="flex flex-col justify-center py-10">
|
|
31
|
+
<h1 className="text-5xl font-extrabold">Power by <p className="text-purple-500 inline">Boltdocs</p></h1>
|
|
32
|
+
<p className="text-xl mt-4 text-text-muted">Docs generators for react.</p>
|
|
33
|
+
</div>
|
|
34
|
+
<Cards cols={4}>
|
|
35
|
+
{features.map((feature) => (
|
|
36
|
+
<Card key={feature.title} title={feature.title} icon={<feature.Icon />}>
|
|
37
|
+
{feature.description}
|
|
38
|
+
</Card>
|
|
39
|
+
))}
|
|
40
|
+
</Cards>
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
6
|
+
"allowJs": false,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"esModuleInterop": false,
|
|
9
|
+
"allowSyntheticDefaultImports": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"module": "ESNext",
|
|
13
|
+
"moduleResolution": "Bundler",
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
"baseUrl": "."
|
|
19
|
+
},
|
|
20
|
+
"include": ["docs", "src", ".boltdocs/types.d.ts"],
|
|
21
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
22
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineConfig } from 'boltdocs'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
siteUrl: 'https://my-docs.com/',
|
|
5
|
+
i18n: {
|
|
6
|
+
locales: ['en', 'es'],
|
|
7
|
+
defaultLocale: 'en',
|
|
8
|
+
},
|
|
9
|
+
theme: {
|
|
10
|
+
title: '{{title}}',
|
|
11
|
+
description: 'Documentation for my project',
|
|
12
|
+
breadcrumbs: true,
|
|
13
|
+
codeTheme: {
|
|
14
|
+
light: 'github-light',
|
|
15
|
+
dark: 'github-dark',
|
|
16
|
+
},
|
|
17
|
+
favicon: '/light.svg',
|
|
18
|
+
logo: {
|
|
19
|
+
dark: '/light.svg',
|
|
20
|
+
light: '/dark.svg',
|
|
21
|
+
alt: 'Boltdocs Logo',
|
|
22
|
+
},
|
|
23
|
+
navbar: [
|
|
24
|
+
{
|
|
25
|
+
label: 'Docs',
|
|
26
|
+
href: '/docs/getting-started',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
// githubRepo: 'bolt-doc/boltdocs',
|
|
30
|
+
},
|
|
31
|
+
robots: {
|
|
32
|
+
rules: [
|
|
33
|
+
{
|
|
34
|
+
userAgent: '*',
|
|
35
|
+
allow: '/',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Empezando
|
|
2
|
+
|
|
3
|
+
Esta es la base para tu nuevo proyecto de **Boltdocs**. Aquí encontrarás todo lo que necesitas para comenzar a escribir y publicar tu contenido.
|
|
4
|
+
|
|
5
|
+
## Inicio rápido
|
|
6
|
+
|
|
7
|
+
1. **Instalar dependencias**:
|
|
8
|
+
```bash
|
|
9
|
+
pnpm install
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
2. **Iniciar el servidor de desarrollo**:
|
|
13
|
+
```bash
|
|
14
|
+
pnpm dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
3. **Ver los resultados**: Abre [http://localhost:5173](http://localhost:5173) en tu navegador.
|
|
18
|
+
|
|
19
|
+
## Escribir Contenido
|
|
20
|
+
|
|
21
|
+
Boltdocs utiliza **Markdown** para el contenido. Simplemente crea archivos `.md` en la carpeta `docs/` y aparecerán automáticamente en tu sitio.
|
|
22
|
+
|
|
23
|
+
### Ejemplo de página:
|
|
24
|
+
|
|
25
|
+
```markdown
|
|
26
|
+
# Mi Título
|
|
27
|
+
|
|
28
|
+
Este es un párrafo de ejemplo. Puedes usar **negrita**, *cursiva* y [enlaces](https://google.com).
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Personalización
|
|
32
|
+
|
|
33
|
+
Puedes modificar el diseño y el comportamiento en `boltdocs.config.ts`. Para cambios más profundos, explora la carpeta `src/`.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Getting Started
|
|
2
|
+
|
|
3
|
+
This is the base for your new **Boltdocs** project. Here you'll find everything you need to start writing and publishing your content.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
1. **Install dependencies**:
|
|
8
|
+
```bash
|
|
9
|
+
pnpm install
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
2. **Start development server**:
|
|
13
|
+
```bash
|
|
14
|
+
pnpm dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
3. **View results**: Open [http://localhost:5173](http://localhost:5173) in your browser.
|
|
18
|
+
|
|
19
|
+
## Writing Content
|
|
20
|
+
|
|
21
|
+
Boltdocs uses **Markdown** for content. Simply create `.md` files in the `docs/` folder and they will automatically appear on your site.
|
|
22
|
+
|
|
23
|
+
### Page Example:
|
|
24
|
+
|
|
25
|
+
```markdown
|
|
26
|
+
# My Title
|
|
27
|
+
|
|
28
|
+
This is an example paragraph. You can use **bold**, *italics*, and [links](https://google.com).
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Customization
|
|
32
|
+
|
|
33
|
+
You can modify the design and behavior in `boltdocs.config.ts`. For deeper changes, explore the `src/` folder.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DocsLayout,
|
|
3
|
+
Navbar,
|
|
4
|
+
Sidebar,
|
|
5
|
+
OnThisPage,
|
|
6
|
+
Head,
|
|
7
|
+
Breadcrumbs,
|
|
8
|
+
PageNav,
|
|
9
|
+
ErrorBoundary,
|
|
10
|
+
CopyMarkdown,
|
|
11
|
+
useRoutes,
|
|
12
|
+
useConfig,
|
|
13
|
+
useMdxComponents,
|
|
14
|
+
useLocation,
|
|
15
|
+
getTranslated
|
|
16
|
+
} from 'boltdocs/client'
|
|
17
|
+
|
|
18
|
+
export default function Layout({ children }: { children: React.ReactNode }) {
|
|
19
|
+
const {
|
|
20
|
+
routes: filteredRoutes,
|
|
21
|
+
allRoutes,
|
|
22
|
+
currentRoute,
|
|
23
|
+
currentLocale
|
|
24
|
+
} = useRoutes()
|
|
25
|
+
const { pathname } = useLocation()
|
|
26
|
+
const config = useConfig()
|
|
27
|
+
const mdxComponents = useMdxComponents()
|
|
28
|
+
|
|
29
|
+
// Allow CopyMarkdown override via mdx-components.tsx
|
|
30
|
+
const CopyMarkdownComp = (mdxComponents.CopyMarkdown as any) || CopyMarkdown
|
|
31
|
+
|
|
32
|
+
const isDocs = pathname.startsWith('/docs')
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<DocsLayout>
|
|
36
|
+
<Head
|
|
37
|
+
siteTitle={getTranslated(config.theme?.title, currentLocale) || 'Boltdocs'}
|
|
38
|
+
siteDescription={getTranslated(config.theme?.description, currentLocale) || ''}
|
|
39
|
+
routes={allRoutes}
|
|
40
|
+
/>
|
|
41
|
+
<Navbar />
|
|
42
|
+
|
|
43
|
+
<DocsLayout.Body>
|
|
44
|
+
{isDocs && <Sidebar routes={filteredRoutes} config={config} />}
|
|
45
|
+
|
|
46
|
+
<DocsLayout.Content>
|
|
47
|
+
<DocsLayout.ContentMdx>
|
|
48
|
+
{isDocs && (
|
|
49
|
+
<DocsLayout.ContentHeader>
|
|
50
|
+
<Breadcrumbs />
|
|
51
|
+
<CopyMarkdownComp
|
|
52
|
+
mdxRaw={currentRoute?._rawContent}
|
|
53
|
+
route={currentRoute}
|
|
54
|
+
config={config.theme?.copyMarkdown}
|
|
55
|
+
/>
|
|
56
|
+
</DocsLayout.ContentHeader>
|
|
57
|
+
)}
|
|
58
|
+
|
|
59
|
+
<ErrorBoundary>{children}</ErrorBoundary>
|
|
60
|
+
|
|
61
|
+
{isDocs && (
|
|
62
|
+
<DocsLayout.ContentFooter>
|
|
63
|
+
<PageNav />
|
|
64
|
+
</DocsLayout.ContentFooter>
|
|
65
|
+
)}
|
|
66
|
+
</DocsLayout.ContentMdx>
|
|
67
|
+
</DocsLayout.Content>
|
|
68
|
+
|
|
69
|
+
{isDocs && (
|
|
70
|
+
<OnThisPage
|
|
71
|
+
headings={currentRoute?.headings}
|
|
72
|
+
editLink={config.theme?.editLink}
|
|
73
|
+
communityHelp={config.theme?.communityHelp}
|
|
74
|
+
filePath={currentRoute?.filePath}
|
|
75
|
+
/>
|
|
76
|
+
)}
|
|
77
|
+
</DocsLayout.Body>
|
|
78
|
+
</DocsLayout>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Navbar } from 'boltdocs/client';
|
|
2
|
+
import { Footer } from '../../src/components/footer';
|
|
3
|
+
import { HomePage } from '../../src/pages/home'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Custom home page for the site.
|
|
7
|
+
* This overrides any homePage set in boltdocs.config.ts.
|
|
8
|
+
*/
|
|
9
|
+
export const homePage = HomePage;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Custom external routes.
|
|
13
|
+
* Maps paths to React components.
|
|
14
|
+
*/
|
|
15
|
+
// export const pages = {
|
|
16
|
+
// pricing: PricingPage
|
|
17
|
+
// };
|
|
18
|
+
|
|
19
|
+
export const layout = ({ children }: { children: React.ReactNode }) => <div className='pb-10'>
|
|
20
|
+
<Navbar />
|
|
21
|
+
{children}
|
|
22
|
+
<Footer />
|
|
23
|
+
</div>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");
|
|
2
|
+
@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap");
|
|
3
|
+
|
|
4
|
+
@import "tailwindcss";
|
|
5
|
+
|
|
6
|
+
@import "boltdocs/theme/neutral.css";
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
@source directive tells Tailwind to scan Boltdocs client components
|
|
10
|
+
inside node_modules for class usage and generate the necessary CSS.
|
|
11
|
+
*/
|
|
12
|
+
@source "./node_modules/boltdocs/src/client";
|