feat: implement ui i18n support

This commit is contained in:
草师傅 2025-08-11 16:06:14 +08:00
parent 457fb93718
commit 698c411c71
Signed by: gb
GPG key ID: 43330A030E2D6478
13 changed files with 162 additions and 54 deletions

View file

@ -1,10 +1,10 @@
import { defineConfig } from 'astro/config';
import {defineConfig} from 'astro/config';
import sitemap from '@astrojs/sitemap';
import mdx from '@astrojs/mdx';
import { remarkWordCount } from './src/plugins/remark/wordcount.js';
import {remarkWordCount} from './src/plugins/remark/wordcount.js';
import cloudflare from '@astrojs/cloudflare';
import remarkMath from "remark-math";
@ -14,28 +14,33 @@ import partytown from '@astrojs/partytown';
import {remarkModifiedTime} from "./src/plugins/remark/modified-time.mjs";
export default defineConfig({
site: 'https://terminal-blog.example.com',
base: '/',
trailingSlash: 'ignore',
redirects: {
// for the old routes still can be accessed
"/post/[...slug]": "/blog/[...slug]"
},
build: {
format: 'directory'
},
markdown: {
shikiConfig: {
theme: 'nord',
wrap: true
site: 'https://terminal-blog.example.com',
base: '/',
trailingSlash: 'ignore',
redirects: {
// for the old routes still can be accessed
"/post/[...slug]": "/blog/[...slug]"
},
remarkPlugins: [ remarkMath, remarkWordCount, remarkModifiedTime ],
rehypePlugins: [ rehypeKatex ]
},
integrations: [sitemap(), mdx(), partytown()],
build: {
format: 'directory'
},
adapter: cloudflare()
markdown: {
shikiConfig: {
theme: 'nord',
wrap: true
},
remarkPlugins: [remarkMath, remarkWordCount, remarkModifiedTime],
rehypePlugins: [rehypeKatex]
},
i18n: {
locales: ["en", "zh_hans"],
defaultLocale: "en",
},
integrations: [sitemap(), mdx(), partytown()],
adapter: cloudflare()
});