Skip to content

Commit

Permalink
Change base url config
Browse files Browse the repository at this point in the history
  • Loading branch information
ihavecoke committed Oct 31, 2023
1 parent eaa40f5 commit 8073913
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DefaultTheme, defineConfig } from 'vitepress';
// @ts-ignore
import docs from '../docs/docs.json';

const convertDocsToZhHK = (docs: Record<string, any>[]) => {};
Expand Down Expand Up @@ -39,7 +40,7 @@ const docsSidebarZHHK = convertDocsToSidebars(docs, 'zh-HK');
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Longbridge Whale Docs',
base: '/whale-docs/',
base: '/docs/',
ignoreDeadLinks: true,
locales: {
en: {
Expand Down
8 changes: 5 additions & 3 deletions scripts/cn2hk.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ const OpenCC = require('opencc-js');

const converter = OpenCC.Converter({ from: 'cn', to: 'hk' });


/**
* Iterator all .md file in docs/zh-CN/ and convert to docs/zh-HK/
*/
const convert = () => {
let content = fs.readFileSync('docs/zh-CN.md', 'utf8');
if(!fs.existsSync(path.resolve(__dirname,'../docs/zh-CN.md'))) return
let content = fs.readFileSync(path.resolve(__dirname,'../docs/zh-CN.md'), 'utf8');
let newContent = converter(content);
fs.writeFileSync('docs/zh-HK.md', newContent);
fs.writeFileSync(path.resolve(__dirname,'../docs/zh-CN.md'), newContent);

let files = glob.sync('docs/zh-CN/**/*.md');
let files = glob.sync(path.resolve(__dirname,'../docs/zh-CN/**/*.md'));
files.forEach((file) => {
let content = fs.readFileSync(file, 'utf8');
let newContent = converter(content);
Expand Down

0 comments on commit 8073913

Please sign in to comment.