Skip to content

Commit

Permalink
feat: add i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-ub committed Oct 6, 2024
1 parent 9fd849b commit 874e954
Show file tree
Hide file tree
Showing 73 changed files with 3,589 additions and 388 deletions.
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Astro generates this during tests, but we want to ignore it.
src/env.d.ts
21 changes: 0 additions & 21 deletions build.config.ts

This file was deleted.

44 changes: 13 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,21 @@
],
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs"
},
"./theme": {
"types": "./dist/theme.d.ts",
"import": "./dist/theme.mjs"
},
"./schema": {
"types": "./dist/schema.d.ts",
"import": "./dist/schema.mjs"
},
"./routes/*": "./dist/routes/*",
"./components/*": "./dist/components/*"
},
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"*": [
"./dist/*",
"./dist/index.d.ts"
]
}
".": "./src/index.ts",
"./theme": "./src/theme.ts",
"./schema": "./src/schema.ts",
"./locals": "./src/locals.ts",
"./routes/*": "./src/routes/*",
"./components/*": "./src/components/*"
},
"main": "./src/index.ts",
"types": "./src/types.ts",
"files": [
"dist"
"src"
],
"scripts": {
"build": "unbuild",
"dev": "unbuild --stub",
"lint": "eslint .",
"prepublishOnly": "nr build",
"release": "bumpp && npm publish",
"start": "esno src/index.ts",
"test": "vitest",
"typecheck": "tsc --noEmit",
"prepare": "simple-git-hooks && pnpm astro sync",
Expand All @@ -72,8 +51,12 @@
"unocss": "^0.63.2"
},
"dependencies": {
"@astrojs/mdx": "^3.1.7",
"@astrojs/sitemap": "^3.2.0",
"bcp-47": "^2.1.0",
"dayjs": "^1.11.13",
"fast-glob": "^3.3.2",
"i18next": "^23.15.2",
"nprogress": "^0.2.0",
"remark-github-alerts": "0.1.0-beta.3"
},
Expand All @@ -93,7 +76,6 @@
"pnpm": "^9.9.0",
"simple-git-hooks": "^2.11.1",
"typescript": "5.5.4",
"unbuild": "^2.0.0",
"unocss": "^0.63.2",
"vite": "^5.4.3",
"vitest": "^2.0.5"
Expand Down
39 changes: 38 additions & 1 deletion playground/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,46 @@ import UnoCSS from 'unocss/astro'

// https://astro.build/config
export default defineConfig({
integrations: [mdx(), UnoCSS(), vitesse()],
site: 'https://adrianub.dev',
integrations: [
mdx(),
UnoCSS(),
vitesse({
title: 'UB',
credits: true,
logo: {
light: '/src/assets/logo-light.svg',
dark: '/src/assets/logo-dark.svg',
alt: 'UB Logo',
},
defaultLocale: 'root',
locales: {
root: {
lang: 'en',
label: 'English',
},
es: {
lang: 'es',
label: 'Español',
},
},
components: {
Footer: '/src/components/Footer.astro',
},
social: {
twitter: 'https://twitter.com/adrianub',
github: 'https://github.com/adrian-ub/astro-vitesse',
mastodon: 'https://mastodon.social/@adrianub',
},
navBar: [{
label: 'Blog',
slug: 'posts',
}],
}),
],
vite: {
ssr: {
// This is only necessary when doing integration development.
external: ['astro-vitesse'],
},
},
Expand Down
6 changes: 6 additions & 0 deletions playground/src/assets/logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions playground/src/assets/logo-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions playground/src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<span class="text-sm op50"><a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" style="color:inherit">CC BY-NC-SA 4.0</a> 2021-PRESENT © Adrián UB</span>
<div class="flex-auto" />
6 changes: 6 additions & 0 deletions playground/src/content/pages/posts/draft.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: 'Draft example'
date: '2024-10-06'
duration: 5min
draft: true
---
1 change: 0 additions & 1 deletion playground/src/content/pages/posts/markdown-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: 'Markdown Style Guide'
date: '2024-10-04'
duration: 5min
draft: true
---

Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.
Expand Down
Loading

0 comments on commit 874e954

Please sign in to comment.