create-boltdocs 0.2.3 → 0.2.4

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.
@@ -11,7 +11,7 @@ export const pages = {
11
11
  }
12
12
 
13
13
  export const layout = ({ children }: { children: React.ReactNode }) => (
14
- <div className="pb-10">
14
+ <div className="pb-10 px-10">
15
15
  <Navbar />
16
16
  {children}
17
17
  <Footer />
@@ -1,12 +1,13 @@
1
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
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
3
  @import "tailwindcss";
5
4
 
5
+ /* Tailwind must be declared first so the theme can override its styles */
6
+ @import "boltdocs/theme/reset.css";
6
7
  @import "boltdocs/theme/neutral.css";
7
8
 
8
9
  /*
9
10
  @source directive tells Tailwind to scan Boltdocs client components
10
11
  inside node_modules for class usage and generate the necessary CSS.
11
12
  */
12
- @source "./node_modules/boltdocs/src/client";
13
+ @source "./node_modules/boltdocs/src/client";
@@ -1,30 +1,55 @@
1
- import { Card, Cards } from 'boltdocs/client'
1
+ import { Card, Cards, useI18n } from 'boltdocs/client'
2
2
  import { Route, FileText, Settings, Sparkles } from 'lucide-react'
3
3
 
4
4
  const features = [
5
5
  {
6
- title: 'File-route',
7
- description: 'Generate routes from file structure.',
6
+ title: {
7
+ en: 'File-route',
8
+ es: 'Rutas de archivos',
9
+ },
10
+ description: {
11
+ en: 'Generate routes from file structure.',
12
+ es: 'Genera rutas a partir de la estructura de archivos.',
13
+ },
8
14
  Icon: Route,
9
15
  },
10
16
  {
11
- title: 'Markdown',
12
- description: 'Support Markdown for writing documentation.',
17
+ title: {
18
+ en: 'Markdown',
19
+ es: 'Markdown',
20
+ },
21
+ description: {
22
+ en: 'Support Markdown for writing documentation.',
23
+ es: 'Soporte de Markdown para escribir documentación.',
24
+ },
13
25
  Icon: FileText,
14
26
  },
15
27
  {
16
- title: 'Customizable',
17
- description: 'Customizable to your needs.',
28
+ title: {
29
+ en: 'Customizable',
30
+ es: 'Personalizable',
31
+ },
32
+ description: {
33
+ en: 'Customizable to your needs.',
34
+ es: 'Personalizable a tus necesidades.',
35
+ },
18
36
  Icon: Settings,
19
37
  },
20
38
  {
21
- title: 'Secure by design',
22
- description: 'Boltdocs is secure by design.',
39
+ title: {
40
+ en: 'Secure by design',
41
+ es: 'Seguro por diseño',
42
+ },
43
+ description: {
44
+ en: 'Boltdocs is secure by design.',
45
+ es: 'Boltdocs es seguro por diseño.',
46
+ },
23
47
  Icon: Sparkles,
24
48
  },
25
49
  ]
26
50
 
27
51
  export function HomePage() {
52
+ const { currentLocale } = useI18n()
28
53
  return (
29
54
  <div className="w-full h-[calc(100vh-120px)] flex items-center gap-10">
30
55
  <div className="flex flex-col justify-center py-10">
@@ -36,11 +61,15 @@ export function HomePage() {
36
61
  <Cards cols={4}>
37
62
  {features.map((feature) => (
38
63
  <Card
39
- key={feature.title}
40
- title={feature.title}
64
+ key={feature.title.en}
65
+ title={feature.title[currentLocale as keyof typeof feature.title]}
41
66
  icon={<feature.Icon />}
42
67
  >
43
- {feature.description}
68
+ {
69
+ feature.description[
70
+ currentLocale as keyof typeof feature.description
71
+ ]
72
+ }
44
73
  </Card>
45
74
  ))}
46
75
  </Cards>
@@ -11,7 +11,7 @@ export const pages = {
11
11
  }
12
12
 
13
13
  export const layout = ({ children }: { children: React.ReactNode }) => (
14
- <div className="pb-10">
14
+ <div className="pb-10 px-10">
15
15
  <Navbar />
16
16
  {children}
17
17
  <Footer />
@@ -1,12 +1,13 @@
1
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
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
3
  @import "tailwindcss";
5
4
 
5
+ /* Tailwind must be declared first so the theme can override its styles */
6
+ @import "boltdocs/theme/reset.css";
6
7
  @import "boltdocs/theme/neutral.css";
7
8
 
8
9
  /*
9
10
  @source directive tells Tailwind to scan Boltdocs client components
10
11
  inside node_modules for class usage and generate the necessary CSS.
11
12
  */
12
- @source "./node_modules/boltdocs/src/client";
13
+ @source "./node_modules/boltdocs/src/client";
@@ -7,5 +7,5 @@ const locale = {
7
7
 
8
8
  export function Footer() {
9
9
  const { currentLocale } = useI18n()
10
- return <footer>{locale[currentLocale ?? 'en']}</footer>
10
+ return <footer>{locale[currentLocale as keyof typeof locale]}</footer>
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-boltdocs",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Create a new boltdocs project",
5
5
  "type": "module",
6
6
  "author": "Jesus Alcala",
@@ -1,49 +0,0 @@
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">
32
- Power by <p className="text-purple-500 inline">Boltdocs</p>
33
- </h1>
34
- <p className="text-xl mt-4 text-muted">Docs generators for react.</p>
35
- </div>
36
- <Cards cols={4}>
37
- {features.map((feature) => (
38
- <Card
39
- key={feature.title}
40
- title={feature.title}
41
- icon={<feature.Icon />}
42
- >
43
- {feature.description}
44
- </Card>
45
- ))}
46
- </Cards>
47
- </div>
48
- )
49
- }