Skip to content

Commit 8adcaf1

Browse files
committed
docs: add i18n schema and remove plugin
1 parent ef1aee7 commit 8adcaf1

File tree

4 files changed

+19
-23
lines changed

4 files changed

+19
-23
lines changed

docs/astro.config.mjs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -137,25 +137,6 @@ export default defineConfig({
137137
slug: 'notes',
138138
},
139139
],
140-
plugins: [
141-
{
142-
name: 'vitesse-plugin-i18n',
143-
hooks: {
144-
setup: ({ injectTranslations }) => {
145-
injectTranslations({
146-
en: {
147-
'sponsor.thanks': 'If you enjoy my work and find them useful, consider sponsor me to help Open Source sustainable. Thank you!',
148-
'sponsor.to-suport': 'Sponsor to support',
149-
},
150-
es: {
151-
'sponsor.thanks': 'Si disfrutas de mi trabajo y te resulta útil, considera patrocinarme para ayudar a que el Open Source sea sostenible. ¡Gracias!',
152-
'sponsor.to-suport': 'Patrocinar para apoyar a',
153-
},
154-
})
155-
},
156-
},
157-
},
158-
],
159140
}),
160141
],
161142
})

docs/src/content/config.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
import { defineCollection } from 'astro:content'
2-
import { pagesSchema } from 'astro-vitesse/schema'
1+
import { defineCollection, z } from 'astro:content'
2+
import { i18nSchema, pagesSchema } from 'astro-vitesse/schema'
33

44
export const collections = {
5-
pages: defineCollection({
6-
schema: pagesSchema(),
5+
pages: defineCollection({ schema: pagesSchema() }),
6+
i18n: defineCollection({
7+
type: 'data',
8+
schema: i18nSchema({
9+
extend: z.object({
10+
'sponsor.thanks': z.string().optional(),
11+
'sponsor.to-suport': z.string().optional(),
12+
}),
13+
}),
714
}),
815
}

docs/src/content/i18n/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"sponsor.thanks": "If you enjoy my work and find them useful, consider sponsor me to help Open Source sustainable. Thank you!",
3+
"sponsor.to-suport": "Sponsor to support"
4+
}

docs/src/content/i18n/es.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"sponsor.thanks": "Si disfrutas de mi trabajo y te resulta útil, considera patrocinarme para ayudar a que el Open Source sea sostenible. ¡Gracias!",
3+
"sponsor.to-suport": "Patrocinar para apoyar a"
4+
}

0 commit comments

Comments
 (0)