Skip to content

Commit

Permalink
[Docs] Fix paths,config,icon,translate (#2268)
Browse files Browse the repository at this point in the history
* docs Translate to zh_tw

* Docs removing zh_hk

* Modify join.md in zh_tw

* Docs fix skip paths

* Docs add translate of zh_tw

* Docs Fixed paths

* Docs Add i18n config

* Docs Add i18n config

* Docs Fixed i18n config

* Docs Test i18n config

* Docs Test i18n config

* Docs Fixed i18n config

* Docs Add zh_TW/blog/index.md

* Docs Add zh_TW/blog/index.md

* Docs Fixed some translate

* Docs Fixed tg-icon
  • Loading branch information
ScaredCube committed May 25, 2024
1 parent dd5bec4 commit 26d88e3
Show file tree
Hide file tree
Showing 12 changed files with 377 additions and 31 deletions.
139 changes: 139 additions & 0 deletions .vitepress/config/en_US.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import { defineConfig } from "vitepress";
import AutoSidebar from "vite-plugin-vitepress-auto-sidebar";

// https://vitepress.dev/reference/site-config
export const en_US = defineConfig({
title: "Travellings",
description: "Friend Link Relation Project",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: "Home", link: "/en_US/" },
{ text: "Docs", link: "/en_US/docs/", activeMatch: "/en_US/docs/" },
{ text: "Blog", link: "/en_US/blog/", activeMatch: "/en_US/blog/" },
{ text: "Announcement", link: "/en_US/announcements/", activeMatch: "/en_US/announcements/" },
{ text: "Sponsor", link: "https://afdian.net/a/travellings" },
{ text: "Member List", link: "https://list.travellings.cn" },
{ text: "Travellings GO", link: "/go.html", target: "_blank" },
],

socialLinks: [
{
icon: "github",
link: "https://github.com/travellings-link/travellings",
},
{ icon: "twitter", link: "https://twitter.com/travellings_cn" },
{
icon: {
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M248 8C111 8 0 119 0 256S111 504 248 504 496 393 496 256 385 8 248 8zM363 176.7c-3.7 39.2-19.9 134.4-28.1 178.3-3.5 18.6-10.3 24.8-16.9 25.4-14.4 1.3-25.3-9.5-39.3-18.7-21.8-14.3-34.2-23.2-55.3-37.2-24.5-16.1-8.6-25 5.3-39.5 3.7-3.8 67.1-61.5 68.3-66.7 .2-.7 .3-3.1-1.2-4.4s-3.6-.8-5.1-.5q-3.3 .7-104.6 69.1-14.8 10.2-26.9 9.9c-8.9-.2-25.9-5-38.6-9.1-15.5-5-27.9-7.7-26.8-16.3q.8-6.7 18.5-13.7 108.4-47.2 144.6-62.3c68.9-28.6 83.2-33.6 92.5-33.8 2.1 0 6.6 .5 9.6 2.9a10.5 10.5 0 0 1 3.5 6.7A43.8 43.8 0 0 1 363 176.7z"/></svg>'
},
link: "https://t.me/TravellingsCN"
},
],

editLink: {
pattern:
"https://github.com/travellings-link/travellings/edit/master/:path",
text: "Edit this page on GitHub",
},

logo: {
dark: "/assets/light.png",
light: "/assets/dark.png",
},

siteTitle: false,

footer: {
copyright: "Copyright © 2020-2024 Travellings Project.",
message:
'Released under the GPL License.<br /><a href="https://beian.miit.gov.cn/">闽 ICP 备 2023011626 号 - 1</a><br /><a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=35059102000048">闽公网安备 35059102000048 号</a>',
},

docFooter: {
prev: "Previous Page",
next: "Next Page",
},

darkModeSwitchLabel: "Theme",
darkModeSwitchTitle: "Switch to dark mode",
lightModeSwitchTitle: "Switch to light mode",
sidebarMenuLabel: "Menu",
returnToTopLabel: "Return to top",
externalLinkIcon: true,
},

cleanUrls: true,

locales: {
root: {
label: '简体中文',
lang: 'zh-CN'
},
zh_TW: {
label: '繁體中文',
lang: 'zh-TW',
},
en_US: {
label: 'English',
lang: 'en-US',
},
},

head: [
["link", { rel: "icon", href: "/assets/favicon.png" }],
[
"script",
{
type: "application/ld+json",
innerHTML: JSON.stringify({
'@context': 'https://schema.org/',
'@type': 'Organization',
name: '开往 Travellings',
url: 'https://www.travellings.cn/',
sameAs: 'https://github.com/travellings-link',
logo: 'https://www.travellings.cn/assets/light.png',
email: 'contact@travellings.cn',
slogan: 'We hope to make the Internet open through the Friend Link Relation Project.',
}),
},
],
],

markdown: {
lineNumbers: true,
theme: {
light: "material-theme-lighter",
dark: "material-theme-darker",
},
image: {
lazyLoading: true,
},
},

sitemap: {
hostname: "https://www.travellings.cn",
},

vite: {
plugins: [
AutoSidebar({
titleFromFile: true,
path: "./",
ignoreList: [
"README.md",
"public",
".vitepress",
"node_modules",
"package.json",
"pnpm-lock.yaml",
".gitignore",
".git",
".github",
"/blog/authors.yml",
],
}),
],
},
lastUpdated: true,
});
33 changes: 33 additions & 0 deletions .vitepress/config/index.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { defineConfig } from 'vitepress'
import AutoSidebar from "vite-plugin-vitepress-auto-sidebar";
import { zh_CN } from './zh_CN.mts'
import { zh_TW } from './zh_TW.mts'
import { en_US } from './en_US.mts'

export default defineConfig({
locales: {
root: { label: '简体中文', ...zh_CN },
zh_TW: { label: '繁體中文', ...zh_TW },
en_US: { label: 'English', ...en_US },
},
vite: {
plugins: [
AutoSidebar({
titleFromFile: true,
path: "./",
ignoreList: [
"README.md",
"public",
".vitepress",
"node_modules",
"package.json",
"pnpm-lock.yaml",
".gitignore",
".git",
".github",
"/blog/authors.yml",
],
}),
],
},
})
17 changes: 11 additions & 6 deletions .vitepress/config.mts → .vitepress/config/zh_CN.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { defineConfig } from "vitepress";
import AutoSidebar from "vite-plugin-vitepress-auto-sidebar";

// https://vitepress.dev/reference/site-config
export default defineConfig({
export const zh_CN = defineConfig({
title: "开往",
description: "友链接力",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: "主页", link: "./" },
{ text: "文档", link: "./docs/", activeMatch: "./docs/" },
{ text: "博客", link: "./blog/", activeMatch: "./blog/" },
{ text: "公告", link: "./announcements/", activeMatch: "./announcements/" },
{ text: "主页", link: "/" },
{ text: "文档", link: "/docs/", activeMatch: "/docs/" },
{ text: "博客", link: "/blog/", activeMatch: "/blog/" },
{ text: "公告", link: "/announcements/", activeMatch: "/announcements/" },
{ text: "赞助", link: "https://afdian.net/a/travellings" },
{ text: "成员列表", link: "https://list.travellings.cn" },
{ text: "开往", link: "/go.html", target: "_blank" },
Expand All @@ -23,7 +23,12 @@ export default defineConfig({
link: "https://github.com/travellings-link/travellings",
},
{ icon: "twitter", link: "https://twitter.com/travellings_cn" },
{ icon: "telegram", link: "https://t.me/TravellingsCN"},
{
icon: {
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M248 8C111 8 0 119 0 256S111 504 248 504 496 393 496 256 385 8 248 8zM363 176.7c-3.7 39.2-19.9 134.4-28.1 178.3-3.5 18.6-10.3 24.8-16.9 25.4-14.4 1.3-25.3-9.5-39.3-18.7-21.8-14.3-34.2-23.2-55.3-37.2-24.5-16.1-8.6-25 5.3-39.5 3.7-3.8 67.1-61.5 68.3-66.7 .2-.7 .3-3.1-1.2-4.4s-3.6-.8-5.1-.5q-3.3 .7-104.6 69.1-14.8 10.2-26.9 9.9c-8.9-.2-25.9-5-38.6-9.1-15.5-5-27.9-7.7-26.8-16.3q.8-6.7 18.5-13.7 108.4-47.2 144.6-62.3c68.9-28.6 83.2-33.6 92.5-33.8 2.1 0 6.6 .5 9.6 2.9a10.5 10.5 0 0 1 3.5 6.7A43.8 43.8 0 0 1 363 176.7z"/></svg>'
},
link: "https://t.me/TravellingsCN"
},
],

editLink: {
Expand Down
139 changes: 139 additions & 0 deletions .vitepress/config/zh_TW.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import { defineConfig } from "vitepress";
import AutoSidebar from "vite-plugin-vitepress-auto-sidebar";

// https://vitepress.dev/reference/site-config
export const zh_TW = defineConfig({
title: "開往",
description: "友鏈接力",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: "首頁", link: "/zh_TW/" },
{ text: "檔案", link: "/zh_TW/docs/", activeMatch: "/zh_TW/docs/" },
{ text: "部落格", link: "/zh_TW/blog/", activeMatch: "/zh_TW/blog/" },
{ text: "公告", link: "/zh_TW/announcements/", activeMatch: "/zh_TW/announcements/" },
{ text: "贊助", link: "https://afdian.net/a/travellings" },
{ text: "成員列表", link: "https://list.travellings.cn" },
{ text: "開往GO", link: "/go.html", target: "_blank" },
],

socialLinks: [
{
icon: "github",
link: "https://github.com/travellings-link/travellings",
},
{ icon: "twitter", link: "https://twitter.com/travellings_cn" },
{
icon: {
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M248 8C111 8 0 119 0 256S111 504 248 504 496 393 496 256 385 8 248 8zM363 176.7c-3.7 39.2-19.9 134.4-28.1 178.3-3.5 18.6-10.3 24.8-16.9 25.4-14.4 1.3-25.3-9.5-39.3-18.7-21.8-14.3-34.2-23.2-55.3-37.2-24.5-16.1-8.6-25 5.3-39.5 3.7-3.8 67.1-61.5 68.3-66.7 .2-.7 .3-3.1-1.2-4.4s-3.6-.8-5.1-.5q-3.3 .7-104.6 69.1-14.8 10.2-26.9 9.9c-8.9-.2-25.9-5-38.6-9.1-15.5-5-27.9-7.7-26.8-16.3q.8-6.7 18.5-13.7 108.4-47.2 144.6-62.3c68.9-28.6 83.2-33.6 92.5-33.8 2.1 0 6.6 .5 9.6 2.9a10.5 10.5 0 0 1 3.5 6.7A43.8 43.8 0 0 1 363 176.7z"/></svg>'
},
link: "https://t.me/TravellingsCN"
},
],

editLink: {
pattern:
"https://github.com/travellings-link/travellings/edit/master/:path",
text: "在 GitHub 上編輯此頁",
},

logo: {
dark: "/assets/light.png",
light: "/assets/dark.png",
},

siteTitle: false,

footer: {
copyright: "Copyright © 2020-2024 Travellings Project.",
message:
'Released under the GPL License.<br /><a href="https://beian.miit.gov.cn/">闽 ICP 备 2023011626 号 - 1</a><br /><a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=35059102000048">闽公网安备 35059102000048 号</a>',
},

docFooter: {
prev: "上一頁",
next: "下一頁",
},

darkModeSwitchLabel: "外觀",
darkModeSwitchTitle: "切換到深色模式",
lightModeSwitchTitle: "切換到淺色模式",
sidebarMenuLabel: "目錄",
returnToTopLabel: "回到頂部",
externalLinkIcon: true,
},

cleanUrls: true,

locales: {
root: {
label: '简体中文',
lang: 'zh-CN'
},
zh_TW: {
label: '繁體中文',
lang: 'zh-TW',
},
en_US: {
label: 'English',
lang: 'en-US',
},
},

head: [
["link", { rel: "icon", href: "/assets/favicon.png" }],
[
"script",
{
type: "application/ld+json",
innerHTML: JSON.stringify({
'@context': 'https://schema.org/',
'@type': 'Organization',
name: '开往 Travellings',
url: 'https://www.travellings.cn/',
sameAs: 'https://github.com/travellings-link',
logo: 'https://www.travellings.cn/assets/light.png',
email: 'contact@travellings.cn',
slogan: '我們期望透過友鏈接力讓網路流量變得開放。',
}),
},
],
],

markdown: {
lineNumbers: true,
theme: {
light: "material-theme-lighter",
dark: "material-theme-darker",
},
image: {
lazyLoading: true,
},
},

sitemap: {
hostname: "https://www.travellings.cn",
},

vite: {
plugins: [
AutoSidebar({
titleFromFile: true,
path: "./",
ignoreList: [
"README.md",
"public",
".vitepress",
"node_modules",
"package.json",
"pnpm-lock.yaml",
".gitignore",
".git",
".github",
"/blog/authors.yml",
],
}),
],
},
lastUpdated: true,
});
6 changes: 3 additions & 3 deletions en_US/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Hitherto, 1k+ people have starred the Travellings project, and 1k+ members have
## Links

- Click here [View member list](https://list.travellings.cn)
- Click here [to view the requirements for joining the destination](https://www.travellings.cn/docs/join)
- Click here [View FAQ](https://www.travellings.cn/docs/qa)
- Click here [to view the requirements for joining the Toyou maintenance group](https://www.travellings.cn/docs/toyou)
- Click here [to view the requirements for joining the destination](https://www.travellings.cn/en_US/docs/join)
- Click here [View FAQ](https://www.travellings.cn/en_US/docs/qa)
- Click here [to view the requirements for joining the Toyou maintenance group](https://www.travellings.cn/en_US/docs/toyou)

## Project Recommendation

Expand Down
4 changes: 2 additions & 2 deletions en_US/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ hero:
actions:
- theme: brand
text: Join the project
link: ./docs/join
link: /en_US/docs/join
- theme: alt
text: FAQ
link: ./docs/qa
link: /en_US/docs/qa
features:
- title: Privacy-friendly and Secure
details: The entire site is HTTPS resistant to hijacking; the front and back ends are completely open source and do not violate privacy; the mirror is automatically deployed without manual intervention. All web pages added to the destination are manually screened to ensure that the traffic is clean and high-quality from the source.
Expand Down
4 changes: 2 additions & 2 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ hero:
actions:
- theme: brand
text: 加入开往
link: ./docs/join
link: /docs/join
- theme: alt
text: 疑难解答
link: ./docs/qa
link: /docs/qa

features:
- title: 隐私保护,安全无忧
Expand Down
Loading

0 comments on commit 26d88e3

Please sign in to comment.