Skip to content

Commit

Permalink
Support remove hide docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ihavecoke committed Nov 6, 2023
1 parent a92bac3 commit 1ef45f3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
pull_request:
branches:
- canary
pull_request_target:
branches:
- dev
types: [opened]
jobs:
deploy_canary:
name: vitpress build
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/download_feishu_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
push:
branches:
- feishu/*
pull_request:
branches:
- dev
jobs:
download_feishu_pages:
name: Download feishu pages
Expand Down
2 changes: 1 addition & 1 deletion scripts/hk2cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const glob = require("glob");
const OpenCC = require("opencc-js");
const converter = OpenCC.Converter({ from: "hk", to: "cn" });

// 翻译 MD 文件
const convertMDHK2CN = () => {
console.log("--> Convert feishu pages markdown file to zh-CN");
// before covert should copy full /zh-HK dir to /zh-CN
let files = glob.sync(path.resolve(__dirname, "../locales/zh-CN/**/*.md"));
files.forEach((file) => {
let content = fs.readFileSync(file, "utf8");
Expand Down
11 changes: 5 additions & 6 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

# prepare vitepress workspace
mkdir -p locales/en/docs locales/zh-HK/docs locales/zh-CN/docs
cp -r feishu-pages/docs/en/* locales/en/docs/
cp -r feishu-pages/docs/zh-HK/* locales/zh-HK/docs/
cp -r feishu-pages/docs/zh-HK/* locales/zh-CN/docs/

# diff feishu-pages export docs.json to locale feishu-pages directory witch markdown file if hidde
bun ./scripts/normalize_missing_docs_markdown_fields.js

# cp feishu pages meta config to vitepress workspace
cp -r feishu-pages/docs/en/* locales/en/docs/
cp -r feishu-pages/docs/zh-HK/* locales/zh-HK/docs/
cp -r feishu-pages/docs/zh-HK/* locales/zh-CN/docs/
cp feishu-pages/docs.json locales/

# set docs/guides to /docs index page
Expand All @@ -22,13 +22,12 @@ cp locales/zh-CN/docs/guides.md locales/zh-CN/docs.md
cp locales/zh-HK/docs/guides.md locales/zh-HK/docs/index.md
cp locales/zh-HK/docs/guides.md locales/zh-HK/docs.md

# normalize docs slug to vitepress markdown files or docs.json
bun ./scripts/normalize_slug.js

# translate HK to CN
bun ./scripts/hk2cn.js

# normalize docs slug to vitepress markdown files or docs.json
bun ./scripts/normalize_docs_slug.js

# autocorrect
bun run autocorrect --fix locales/

Expand Down

0 comments on commit 1ef45f3

Please sign in to comment.