Skip to content

Commit 5077101

Browse files
committed
revoke 1000h aliyun deployment
1 parent e3ba6e6 commit 5077101

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

.github/workflows/deploy-1000h-aliyun.yml

+2-19
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,8 @@ jobs:
3535
- name: Install dependencies
3636
run: yarn install
3737

38-
- name: Write Aliyun OSS Config
39-
run: |
40-
cat <<EOF > 1000-hours/.vitepress/config.js
41-
// Aliyun OSS 配置
42-
export default {
43-
base: "/1000-hours/",
44-
transformHtml: (code, id, html) => {
45-
// 使用正则匹配 <span data-audio-*> 并替换路径
46-
let content = html.content.replace(/(<span[^>]*\s)data-audio-([\w-]+)="\/audios\/(.*?)"/g, (match, before, key, value) => {
47-
return \`\${before}data-audio-\${key}="/1000-hours/audios/\${value}"\`
48-
})
49-
50-
return content.replace(/(<span[^>]*\s)data-audio-([\w-]+)="\/audios\/(.*?)"/g, (match, before, key, value) => {
51-
return \`\${before}data-audio-\${key}="/1000-hours/audios/\${value}"\`
52-
})
53-
}
54-
}
55-
EOF
56-
38+
- name: Set Base Path
39+
run: sed -i 's/defineConfig({/defineConfig({"base":"\/1000-hours\/",/g' 1000-hours/.vitepress/config.mts
5740

5841
- name: Build
5942
run: yarn docs:build

1000-hours/.vitepress/config.mts

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ import carousel from "./lib/markdown-it-carousel";
1212
export default withMermaid(
1313
// https://vitepress.dev/reference/site-config
1414
defineConfig({
15+
base: "/1000-hours/",
16+
vue:{
17+
template:{
18+
transformAssetUrls:{
19+
'span':['data-audio-us-female','data-audio-us-male'],
20+
}
21+
}
22+
},
1523
title: "1000 小时",
1624
description: "用注意力填满 1000 小时就能练成任何你需要的技能……",
1725
head: [

0 commit comments

Comments
 (0)