Skip to content

Commit

Permalink
Migrate to VitePress
Browse files Browse the repository at this point in the history
  • Loading branch information
YerongAI committed Sep 26, 2024
1 parent 79ab3a1 commit 24905e2
Show file tree
Hide file tree
Showing 157 changed files with 2,399 additions and 4,936 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 20
- name: Build VuePress site
- name: Build VitePress site
run: npm install && npm run docs:build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: 'docs/.vuepress/dist'
path: 'docs/.vitepress/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
.temp
.cache
.vscode
/docs/.vuepress/dist/
/docs/.vitepress/dist/
/docs/.vitepress/cache/
13 changes: 13 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from 'vitepress'
import { shared } from './shared'
import { en_us } from './en-us'
import { zh_cn } from './zh-cn'

// https://vitepress.dev/reference/site-config
export default defineConfig({
...shared,
locales: {
root: { label: 'English', ...en_us },
"zh-cn": { label: '简体中文', ...zh_cn }
}
})
156 changes: 156 additions & 0 deletions docs/.vitepress/en-us.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
import { defineConfig, type DefaultTheme } from 'vitepress'

export const en_us = defineConfig({
lang: 'en-US',
description: "Office Tool Plus is a powerful and useful tool for Office deployment and management.",
themeConfig: {
nav: nav(),

sidebar: {
'/introduction/': { base: '/introduction/', items: sidebarIntroduction() },
'/usage/': { base: '/usage/', items: sidebarUsage() },
'/help/': { base: '/help/', items: sidebarHelp() }
},

editLink: {
pattern: 'https://github.com/YerongAI/Office-Tool-docs/edit/main/docs/:path',
text: 'Edit this page on GitHub'
},

footer: {
message: '<a href="https://github.com/YerongAI/Office-Tool?tab=MIT-1-ov-file#readme" target="_blank">MIT</a> Licensed',
copyright: `Copyright © 2016 - ${new Date().getFullYear()} <a href="https://www.officetool.plus/" target="_blank">Yerong</a> All Rights Reserved.`
},

docFooter: {
prev: '← Previous page',
next: 'Next page →'
}
}
})

function nav(): DefaultTheme.NavItem[] {
return [
{
text: 'Introduction',
link: '/introduction/what-is-otp',
activeMatch: '/introduction/'
},
{
text: 'Usage',
link: '/usage/deploy/clean-deployment',
activeMatch: '/usage/'
},
{
text: 'Help',
link: '/help/about',
activeMatch: '/help/'
}
]
}

function sidebarIntroduction(): DefaultTheme.SidebarItem[] {
return [
{
text: "Introduction",
collapsed: false,
items: [
{ text: 'What is Office Tool Plus?', link: 'what-is-otp' },
{ text: 'System requirements', link: 'requirement' },
{ text: 'Download', link: 'download' }
]
},
{
text: "Pages",
collapsed: false,
items: [
{ text: 'Deploy', link: 'pages/deploy-page' },
{ text: 'Activate', link: 'pages/activate-page' },
{ text: 'Toolbox', link: 'pages/toolbox-page' },
{ text: 'Convert documents', link: 'pages/convert-doc-page' },
{ text: 'Check hash', link: 'pages/check-hash-page' },
]
}
]
}

function sidebarUsage(): DefaultTheme.SidebarItem[] {
return [
{
text: 'Deploy',
collapsed: false,
items: [
{ text: 'Clean deploy', link: 'deploy/clean-deployment' },
{ text: 'Modify', link: 'deploy/modify-deployment' },
{ text: 'Basic settings', link: 'deploy/settings/basic' },
{ text: 'Advanced settings', link: 'deploy/settings/advanced' }
]
},
{
text: 'Create Office ISO',
collapsed: false,
items: [
{ text: 'Prepare', link: 'deploy/create-iso/prepare' },
{ text: '不含任何配置的 ISO', link: 'deploy/create-iso/no-config' },
{ text: '包含默认配置的 ISO', link: 'deploy/create-iso/default-config' },
{ text: '使用 ISO 命令的 ISO', link: 'deploy/create-iso/iso-command' },
{ text: '使用 loadconfig 命令的 ISO', link: 'deploy/create-iso/config-command' },
{ text: '完全自定义安装的 ISO', link: 'deploy/create-iso/deploy-command' },
]
},
{
text: 'Activation',
collapsed: false,
items: [
{ text: 'What is license?', link: 'activate/what-is-license' },
{ text: 'Activation management', link: 'activate/manage' },
{ text: 'Online activation', link: 'activate/online-activation' },
{ text: 'Phone activation', link: 'activate/phone-activation' },
{ text: 'KMS activation', link: 'activate/kms-activation' }
]
},
{
text: 'Toolbox',
collapsed: false,
items: [
{ text: 'General tools', link: 'toolbox/general' },
{ text: 'Office tools', link: 'toolbox/office' },
{ text: 'Windows tools', link: 'toolbox/windows' }
]
},
{
text: 'Command',
collapsed: false,
items: [
{ text: 'Keyboard shortcuts', link: 'command/keyboard' },
{ text: 'Application commands', link: 'command/application' },
{ text: 'Deploy commands', link: 'command/deploy' },
{ text: 'Activation commands', link: 'command/activate' }
]
},
{
text: 'Others',
collapsed: false,
items: [
{ text: 'Check hash' },
{ text: 'Settings', link: 'settings' },
{ text: 'Updates' }
]
}
]
}

function sidebarHelp(): DefaultTheme.SidebarItem[] {
return [
{
text: 'Help',
collapsed: false,
items: [
{ text: 'About', link: 'about' },
{ text: 'Application', link: 'application' },
{ text: 'Deploy', link: 'deploy' },
{ text: 'Activation', link: 'activation' }
]
}
]
}
34 changes: 34 additions & 0 deletions docs/.vitepress/shared.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { defineConfig } from 'vitepress'

export const shared = defineConfig({
title: 'Office Tool Plus',

lastUpdated: true,
cleanUrls: true,
metaChunk: true,

/* prettier-ignore */
head: [
['link', { rel: 'icon', href: '/logo.ico' }],
['meta', { name: 'theme-color', content: '#0078D4' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:locale', content: 'en' }],
['meta', { property: 'og:title', content: 'Office Tool Plus | Documentation' }],
['meta', { property: 'og:site_name', content: 'Office Tool Plus' }],
['meta', { property: 'og:image', content: 'https://img.lancdn.co/otp/global/x/header-x.png' }],
['meta', { property: 'og:url', content: 'https://otp.landian.vip/' }],
],

themeConfig: {
logo: '/logo.ico',

socialLinks: [
{ icon: 'github', link: 'https://github.com/YerongAI/Office-Tool' },
{ icon: 'discord', link: 'https://discord.gg/TpXTgfgf2a' }
],

search: {
provider: 'local'
}
}
})
Loading

0 comments on commit 24905e2

Please sign in to comment.