Skip to content

Commit

Permalink
update nav bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Leawind committed Oct 16, 2024
1 parent 8974e2d commit dc81c21
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
10 changes: 10 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import fs from 'fs';
import path from 'path';

import { defineConfig } from 'vitepress';
import locales from './locales.mts';

Expand Down Expand Up @@ -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',
Expand All @@ -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');
}
10 changes: 9 additions & 1 deletion docs/.vitepress/locales/en-US.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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`),
Expand Down
10 changes: 9 additions & 1 deletion docs/.vitepress/locales/zh-CN.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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`),
Expand Down

0 comments on commit dc81c21

Please sign in to comment.