change to single language.

This commit is contained in:
zeroornull
2025-03-11 16:36:08 +08:00
parent fb5f3f05c4
commit e880fde93a
36 changed files with 635 additions and 1659 deletions

View File

@@ -5,21 +5,12 @@ import theme from "./theme.js";
export default defineUserConfig({
base: "/",
locales: {
"/": {
lang: "en-US",
title: "Docs Demo",
description: "A docs demo for vuepress-theme-hope",
},
"/zh/": {
lang: "zh-CN",
title: "文档演示",
description: "vuepress-theme-hope 的文档演示",
},
},
lang: "zh-CN",
title: "文档演示",
description: "vuepress-theme-hope 的文档演示",
theme,
// Enable it with pwa
// 和 PWA 一起启用
// shouldPrefetch: false,
});

View File

@@ -1,13 +1,13 @@
import { navbar } from "vuepress-theme-hope";
export const zhNavbar = navbar([
"/zh/",
"/zh/portfolio",
"/zh/demo/",
export default navbar([
"/",
"/portfolio",
"/demo/",
{
text: "指南",
icon: "lightbulb",
prefix: "/zh/guide/",
prefix: "/guide/",
children: [
{
text: "Bar",

View File

@@ -1,31 +0,0 @@
import { navbar } from "vuepress-theme-hope";
export const enNavbar = navbar([
"/",
"/portfolio",
"/demo/",
{
text: "Guide",
icon: "lightbulb",
prefix: "/guide/",
children: [
{
text: "Bar",
icon: "lightbulb",
prefix: "bar/",
children: ["baz", { text: "...", icon: "ellipsis", link: "#" }],
},
{
text: "Foo",
icon: "lightbulb",
prefix: "foo/",
children: ["ray", { text: "...", icon: "ellipsis", link: "#" }],
},
],
},
{
text: "V2 Docs",
icon: "book",
link: "https://theme-hope.vuejs.press/",
},
]);

View File

@@ -1,2 +0,0 @@
export * from "./en.js";
export * from "./zh.js";

View File

@@ -1,7 +1,7 @@
import { sidebar } from "vuepress-theme-hope";
export const zhSidebar = sidebar({
"/zh/": [
export default sidebar({
"/": [
"",
"portfolio",
{

View File

@@ -1,26 +0,0 @@
import { sidebar } from "vuepress-theme-hope";
export const enSidebar = sidebar({
"/": [
"",
"portfolio",
{
text: "Demo",
icon: "laptop-code",
prefix: "demo/",
link: "demo/",
children: "structure",
},
{
text: "Docs",
icon: "book",
prefix: "guide/",
children: "structure",
},
{
text: "Slides",
icon: "person-chalkboard",
link: "https://ecosystem.vuejs.press/plugins/markdown/revealjs/demo.html",
},
],
});

View File

@@ -1,2 +0,0 @@
export * from "./en.js";
export * from "./zh.js";

View File

@@ -1,7 +1,7 @@
import { hopeTheme } from "vuepress-theme-hope";
import { enNavbar, zhNavbar } from "./navbar/index.js";
import { enSidebar, zhSidebar } from "./sidebar/index.js";
import navbar from "./navbar.js";
import sidebar from "./sidebar.js";
export default hopeTheme({
hostname: "https://vuepress-theme-hope-docs-demo.netlify.app",
@@ -17,58 +17,35 @@ export default hopeTheme({
docsDir: "src",
locales: {
"/": {
// navbar
navbar: enNavbar,
// 导航栏
navbar,
// sidebar
sidebar: enSidebar,
// 侧边栏
sidebar,
footer: "Default footer",
displayFooter: true,
metaLocales: {
editLink: "Edit this page on GitHub",
},
},
/**
* Chinese locale config
*/
"/zh/": {
// navbar
navbar: zhNavbar,
// sidebar
sidebar: zhSidebar,
footer: "默认页脚",
displayFooter: true,
// page meta
metaLocales: {
editLink: "在 GitHub 上编辑此页",
},
},
},
// 页脚
footer: "默认页脚",
displayFooter: true,
// 加密配置
encrypt: {
config: {
"/demo/encrypt.html": {
hint: "Password: 1234",
password: "1234",
},
"/zh/demo/encrypt.html": {
hint: "Password: 1234",
password: "1234",
},
},
},
// These features are enabled for demo, only preserve features you need here
// 多语言配置
metaLocales: {
editLink: "在 GitHub 上编辑此页",
},
// 如果想要实时查看任何改变,启用它。注: 这对更新性能有很大负面影响
// hotReload: true,
// 此处开启了很多功能用于演示,你应仅保留用到的功能。
markdown: {
align: true,
attrs: true,
@@ -102,45 +79,47 @@ export default hopeTheme({
tasklist: true,
vPre: true,
// uncomment these if you need TeX support
// 取消注释它们如果你需要 TeX 支持
// math: {
// // install katex before enabling it
// // 启用前安装 katex
// type: "katex",
// // or install mathjax-full before enabling it
// // 或者安装 mathjax-full
// type: "mathjax",
// },
// install chart.js before enabling it
// 如果你需要幻灯片,安装 @vuepress/plugin-revealjs 并取消下方注释
// revealjs: {
// plugins: ["highlight", "math", "search", "notes", "zoom"],
// },
// 在启用之前安装 chart.js
// chartjs: true,
// install echarts before enabling it
// insert component easily
// 在启用之前安装 echarts
// echarts: true,
// install flowchart.ts before enabling it
// 在启用之前安装 flowchart.ts
// flowchart: true,
// install mermaid before enabling it
// 在启用之前安装 mermaid
// mermaid: true,
// playground: {
// presets: ["ts", "vue"],
// },
// install @vue/repl before enabling it
// 在启用之前安装 @vue/repl
// vuePlayground: true,
// install sandpack-vue3 before enabling it
// 在启用之前安装 sandpack-vue3
// sandpack: true,
// install @vuepress/plugin-revealjs and uncomment these if you need slides
// revealjs: {
// plugins: ["highlight", "math", "search", "notes", "zoom"],
// },
},
// 在这里配置主题提供的插件
plugins: {
// Note: This is for testing ONLY!
// You MUST generate and use your own comment service in production.
// 注意: 仅用于测试! 你必须自行生成并在生产环境中使用自己的评论服务
comment: {
provider: "Giscus",
repo: "vuepress-theme-hope/giscus-discussions",
@@ -157,7 +136,7 @@ export default hopeTheme({
prefix: "fa6-solid:",
},
// Install @vuepress/plugin-pwa and uncomment these if you want a PWA
// 如果你需要 PWA。安装 @vuepress/plugin-pwa 并取消下方注释
// pwa: {
// favicon: "/favicon.ico",
// cacheHTML: true,