Skip to content

Commit

Permalink
feat: 支持中文配置,优化访问链接
Browse files Browse the repository at this point in the history
  • Loading branch information
Chu Fan committed Mar 1, 2023
1 parent 62a399d commit 59d6c21
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 12 deletions.
5 changes: 3 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

### 在线浏览

<https://142vip.cn/JavaScriptCollection>
- 尝鲜版:<https://142vip.github.io/JavaScriptCollection>
- 稳定版:<https://142vip.cn/JavaScriptCollection>


网站无法访问时,建议通过科学上网访问备用网络

- Github: <https://142vip.github.io/JavaScriptCollection>
- Netlify: <https://js-collection.netlify.app>
- Vercel: <https://js-collection.vercel.app>

Expand Down
1 change: 0 additions & 1 deletion docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export default defineUserConfig({
level: [2, 3, 4]
}
},

// 主题配置
...themeConfig,
// 插件配置
Expand Down
83 changes: 83 additions & 0 deletions docs/.vuepress/config/lang.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import {ThemeLocaleData} from "vuepress-theme-hope";

/**
* 支持中文
* 参考:https://theme-hope.vuejs.press/zh/config/i18n.html
*/
const localCN: ThemeLocaleData = {
lang: "zh-CN",
navbarLocales: {
langName: "简体中文",
selectLangAriaLabel: "选择语言",
},
metaLocales: {
author: "作者",
date: "写作日期",
origin: "原创",
views: "访问量",
category: "分类",
tag: "标签",
readingTime: "阅读时间",
words: "字数",
toc: "标题大纲",
prev: "上一页",
next: "下一页",
lastUpdated: "上次编辑于",
contributors: "贡献者",
editLink: "编辑此页",
print: "打印",
},

blogLocales: {
article: "文章",
articleList: "文章列表",
category: "分类",
tag: "标签",
timeline: "时间轴",
timelineTitle: "昨日不在",
all: "全部",
intro: "个人介绍",
star: "收藏",
},

paginationLocales: {
prev: "上一页",
next: "下一页",
navigate: "跳转到",
action: "前往",
errorText: "请输入 1 到 $page 之前的页码!",
},

outlookLocales: {
themeColor: "主题色",
darkmode: "外观",
fullscreen: "全屏",
},

encryptLocales: {
iconLabel: "文章已加密",
placeholder: "输入密码",
remember: "记住密码",
errorHint: "请输入正确的密码",
},
routeLocales: {
skipToContent: "跳至主要內容",
notFoundTitle: "访问的页面不存在,嘤嘤嘤",
notFoundMsg: [
"这里什么也没有",
"我们是怎么来到这儿的?",
"这 是 四 零 四 !",
"看起来你访问了一个失效的链接",
],
back: "返回",
home: "首页",
openInNewWindow: "新窗口打开",
},
}

/**
* 自定义语言,支持文案
*/
export const langConfig = {
"/": localCN
}
12 changes: 8 additions & 4 deletions docs/.vuepress/config/theme.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import navbar from "./navbar";
import sidebar from "./sidebar";
import {FOOTER_HTML_INFO} from "./constant.config";
import {hopeTheme} from "vuepress-theme-hope";
import {langConfig} from "./lang.config";

/**
* 主题相关配置
* 参考主题:https://theme-hope.vuejs.press/zh/config/intro.html#%E9%85%8D%E7%BD%AE%E6%A6%82%E5%BF%B5
*/
export default {
theme: hopeTheme({
locales: langConfig,
navbarIcon: false,
darkmode: "toggle",
// 支持全屏
Expand All @@ -17,7 +19,7 @@ export default {
// pure: true,
hostname: 'https://408.142vip.cn',
author: {
name: 'Chu·Fan',
name: '储凡',
email: 'fairy_408@2925.com',
url: 'https://www.142vip.cn'
},
Expand All @@ -31,13 +33,15 @@ export default {
end: ["Language", "Search", "Repo", "Outlook",]
},
sidebar: sidebar,
// sidebar: "heading",

pageInfo: ["Author", "Original", "Date", "Category", "Tag", "ReadingTime"],
// 主题布局选项
docsRepo: "https://github.com/142vip/JavaScriptCollection.git",
repo: "https://github.com/142vip/JavaScriptCollection",
docsRepo: "https://github.com/142vip/JavaScriptCollection",
docsDir: "docs",
docsBranch: "master",
repo: "https://github.com/142vip/JavaScriptCollection.git",
// logoDark: "/assets/408_logo.png",
// logo: "/assets/408_logo.png",

// 博客配置
blog: {
Expand Down
10 changes: 5 additions & 5 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,17 @@ yarn run dev
查看项目启动日志并访问:[http://127.0.0.1:5000](http://localhost:5000),开启学习之旅吧~


## 在线浏览
### 在线浏览

<https://142vip.cn/JavaScriptCollection>
- 尝鲜版:<https://142vip.github.io/JavaScriptCollection>
- 稳定版:<https://142vip.cn/JavaScriptCollection>

网站无法访问时,建议通过科学`上网访问`备用网络

- Github: <https://142vip.github.io/JavaScriptCollection>
网站无法访问时,建议通过科学上网访问备用网络

- Netlify: <https://js-collection.netlify.app>
- Vercel: <https://js-collection.vercel.app>


## 提交记录


Expand Down

0 comments on commit 59d6c21

Please sign in to comment.