diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index b9ec9bcf..d6021070 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -1,3 +1,6 @@ +import fs from 'fs'; +import path from 'path'; + import { defineConfig } from 'vitepress'; import locales from './locales.mts'; @@ -30,6 +33,8 @@ export default defineConfig({ externalLinkIcon: true, socialLinks: [ { link: 'https://github.com/LEAWIND/Third-Person', icon: 'github' }, + { link: 'https://www.curseforge.com/minecraft/mc-mods/leawind-third-person', icon: { svg: file('/icons/curseforge.svg') } }, + { link: 'https://modrinth.com/mod/leawind-third-person', icon: { svg: file('/icons/modrinth.svg') } }, ], search: { provider: 'local', @@ -53,3 +58,8 @@ export default defineConfig({ locales: await locales(), }); + +function file(rpath: string) { + const filePath = path.join('docs/public', rpath); + return fs.readFileSync(filePath, 'utf8'); +} diff --git a/docs/.vitepress/locales/en-US.mts b/docs/.vitepress/locales/en-US.mts index 4cbd9afb..4b6bb393 100644 --- a/docs/.vitepress/locales/en-US.mts +++ b/docs/.vitepress/locales/en-US.mts @@ -10,11 +10,19 @@ export default { description: "Documentation of minecraft mod Leawind's Thrid Person", themeConfig: { nav: [ - { text: '💬Q&A', link: `https://github.com/Leawind/Third-Person/discussions/categories/q-a` }, { text: '🔬Details', link: `/${lang}/Details/` }, { text: '⚔️Compatibility', link: `/${lang}/compatibility` }, { text: '🕗Changelog', link: `/${lang}/changelog` }, { text: '💰Donate', link: `/${lang}/donate` }, + { text: '💬Q&A', link: `https://github.com/Leawind/Third-Person/discussions/categories/q-a` }, + { + text: "Download", + items: [ + { text: 'CurseForge', link: `https://www.curseforge.com/minecraft/mc-mods/leawind-third-person` }, + { text: 'Modrinth', link: `https://modrinth.com/mod/leawind-third-person` }, + { text: 'Github Release', link: `https://github.com/LEAWIND/Third-Person/releases` }, + ], + }, ], sidebar: { '/en-US/Details': buildSidebar(`/${lang}/Details`), diff --git a/docs/.vitepress/locales/zh-CN.mts b/docs/.vitepress/locales/zh-CN.mts index b9c2b6fc..b7dc10cf 100644 --- a/docs/.vitepress/locales/zh-CN.mts +++ b/docs/.vitepress/locales/zh-CN.mts @@ -10,11 +10,19 @@ export default { description: "一个Minecraft模组 Leawind的第三人称 的文档", themeConfig: { nav: [ - { text: '💬疑问', link: `https://github.com/Leawind/Third-Person/discussions/categories/q-a` }, { text: '🔬详细', link: `/${lang}/Details/` }, { text: '⚔️兼容性', link: `/${lang}/compatibility` }, { text: '🕗更新日志', link: `/${lang}/changelog` }, { text: '💰捐赠', link: `/${lang}/donate` }, + { text: '💬疑问', link: `https://github.com/Leawind/Third-Person/discussions/categories/q-a` }, + { + text: "下载", + items: [ + { text: 'CurseForge', link: `https://www.curseforge.com/minecraft/mc-mods/leawind-third-person` }, + { text: 'Modrinth', link: `https://modrinth.com/mod/leawind-third-person` }, + { text: 'Github Release', link: `https://github.com/LEAWIND/Third-Person/releases` }, + ], + }, ], sidebar: { '/zh-CN/Details': buildSidebar(`/${lang}/Details`),