File tree Expand file tree Collapse file tree 11 files changed +238
-20
lines changed
Expand file tree Collapse file tree 11 files changed +238
-20
lines changed Original file line number Diff line number Diff line change 4545 uses : actions/configure-pages@v4
4646 - name : Install dependencies
4747 run : npm ci # 或 pnpm install / yarn install / bun install
48+ - name : generate config/env file
49+ env :
50+ GISCUS_TOKEN : ${{ secrets.GISCUS_CONFIG }}
51+ run : echo "$GISCUS_TOKEN" > ./src/.vitepress/config/env.js
4852 - name : Build with VitePress
4953 run : npm run docs:build # 或 pnpm docs:build / yarn docs:build / bun run docs:build
5054 - name : Upload artifact
Original file line number Diff line number Diff line change 1+ # Node.js
2+ node_modules /
3+ npm-debug.log *
4+ yarn-debug.log *
5+ yarn-error.log *
6+ pnpm-debug.log *
7+ .bun
8+
9+ # Logs
10+ logs
11+ * .log
12+ * .log. *
13+
14+ # VitePress
15+ docs /.vitepress /dist
16+ docs /.vitepress /cache
17+
18+ # Editor directories and files
19+ .idea /
20+ .vscode /
21+ * .suo
22+ * .ntvs *
23+ * .njsproj
24+ * .sln
25+
26+ # MacOS
27+ .DS_Store
28+
29+ # Linux
30+ * ~
31+
32+ # Windows
33+ Thumbs.db
Original file line number Diff line number Diff line change 11import { defineConfig } from 'vitepress'
2+ import sidebar from "./config/sidebar.js" ;
23
34// https://vitepress.dev/reference/site-config
45export default defineConfig ( {
@@ -21,28 +22,38 @@ export default defineConfig({
2122 } ,
2223 themeConfig : {
2324 // https://vitepress.dev/reference/default-theme-config
25+ logo : "https://avatars.githubusercontent.com/u/178354211?s=200&v=4" ,
2426 nav : [
2527 { text : 'Home' , link : '/' } ,
2628 { text : 'Events' , link : '/events/' } ,
2729 { text : 'About' , link : '/about.html' }
2830 ] ,
29- sidebar : [
30- {
31- '/events/' : [
32- {
33- text : 'Event Materials' ,
34- items : [
35- { text : 'AY2425' , link : '/events/AY2425' }
36- ]
37- }
38- ]
39- }
40- ] ,
31+ sidebar : sidebar ,
4132 search : {
4233 provider : 'local'
4334 } ,
4435 socialLinks : [
4536 { icon : 'github' , link : 'https://github.com/CompPsyUnion/' }
46- ]
37+ ] ,
38+ footer : {
39+ message : "MIT Licensed" ,
40+ copyright : "Copyright © 2024-present CompPsyUnion" ,
41+ } ,
42+ docFooter : {
43+ prev : "上一页" ,
44+ next : "下一页" ,
45+ } ,
46+ editLink : {
47+ text : "在 GitHub 上编辑此页" ,
48+ pattern :
49+ "https://github.com/CompPsyUnion/CPU_Tech_Forum/edit/main/src/:path" ,
50+ } ,
51+ lastUpdated : {
52+ text : "最后更新于" ,
53+ formatOptions : {
54+ dateStyle : "short" ,
55+ timeStyle : "medium" ,
56+ } ,
57+ } ,
4758 }
4859} )
Original file line number Diff line number Diff line change 1+ export default {
2+ repo : "CompPsyUnion/CPU_Tech_Forum" ,
3+ repoId : "R_kgDONGcOZQ" ,
4+ category : "General" ,
5+ categoryId : "DIC_kwDONGcOZc4Cj5Hk" ,
6+ } ;
Original file line number Diff line number Diff line change 1+ export default [
2+ {
3+ items : [
4+ { text : "AY2425" , link : "/events/" } ,
5+ { text : "241018" , link : "/events/AY2425/241018" } ,
6+ { text : "241101" , link : "/events/AY2425/241101" } ,
7+ ] ,
8+ } ,
9+ ] ;
Original file line number Diff line number Diff line change 11// .vitepress/theme/index.js
22import DefaultTheme from 'vitepress/theme'
3+ import Layout from "./layout.vue" ;
34import './custom.css'
45
5- export default DefaultTheme
6+ export default {
7+ ...DefaultTheme ,
8+ Layout,
9+ async enhanceApp ( ctx ) {
10+ // extend default theme custom behaviour.
11+ DefaultTheme . enhanceApp ( ctx ) ;
12+ // register your custom global components
13+ } ,
14+ } ;
Original file line number Diff line number Diff line change 1+ <script setup>
2+ import {ref , watch } from " vue" ;
3+ import {useData , useRoute } from " vitepress" ;
4+ import DefaultTheme from " vitepress/theme" ;
5+ import envConfig from " ../config/env.js" ;
6+
7+ const {Layout } = DefaultTheme;
8+ const {isDark } = useData ();
9+ const isDev = import .meta.env.DEV;
10+ const route = useRoute ();
11+ const showComment = ref (true );
12+
13+ watch (
14+ () => route .path ,
15+ () => {
16+ // if (isDev){
17+ // showComment.value = false;
18+ // return;
19+ // }
20+ if (route .path === ' /' ) {
21+ showComment .value = false ;
22+ return ;
23+ }
24+ showComment .value = false ;
25+ setTimeout (() => {
26+ showComment .value = true ;
27+ }, 200 );
28+ },
29+ {
30+ immediate: true ,
31+ }
32+ );
33+ </script >
34+
35+ <template >
36+ <Layout >
37+ <template #doc-after >
38+ <div v-if =" showComment" style =" padding-top : 24px " >
39+ <component
40+ :key =" route.path"
41+ is =" script"
42+ src =" https://giscus.app/client.js"
43+ data-id =" comments"
44+ :data-repo =" envConfig.repo"
45+ :data-repo-id =" envConfig.repoId"
46+ :data-category =" envConfig.category"
47+ :data-category-id =" envConfig.categoryId"
48+ data-mapping =" url"
49+ data-strict =" 1"
50+ data-reactions-enabled =" 1"
51+ data-emit-metadata =" 0"
52+ data-input-position =" top"
53+ :data-theme =" isDark ? 'dark' : 'light'"
54+ data-lang =" zh-CN"
55+ data-crossorigin =" anonymous"
56+ data-loading =" lazy"
57+ async ></component >
58+ </div >
59+ </template >
60+ </Layout >
61+ </template >
Original file line number Diff line number Diff line change 44
55## 王修奇:Introduction to Git
66
7- ## 徐安植:Introduction to Git
7+ ## 徐安植:Introduction to Git
8+
Original file line number Diff line number Diff line change 1+ ---
2+ title : Events
3+ description : " Events"
4+ permalink : /events/
5+ ---
6+
17# Events Materials
28
3- 查看或下载活动材料。
9+ 查看或下载活动材料。
10+
You can’t perform that action at this time.
0 commit comments