-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e60d61f
Showing
189 changed files
with
1,771,101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程 | ||
# | ||
name: Deploy VitePress site to Pages | ||
|
||
on: | ||
# 在针对 `main` 分支的推送上运行。如果你 | ||
# 使用 `master` 分支作为默认分支,请将其更改为 `master` | ||
push: | ||
branches: [main] | ||
|
||
# 允许你从 Actions 选项卡手动运行此工作流程 | ||
workflow_dispatch: | ||
|
||
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列 | ||
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成 | ||
concurrency: | ||
group: pages | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# 构建工作 | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要 | ||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: latest | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: pnpm # 或 pnpm / yarn | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Install dependencies | ||
run: pnpm i # 或 pnpm install / yarn install / bun install | ||
- name: Build with VitePress | ||
run: pnpm build # 或 pnpm build / yarn build / bun run build | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: docs/.vitepress/dist | ||
|
||
# 部署工作 | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: build | ||
runs-on: ubuntu-latest | ||
name: Deploy | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/node_modules | ||
/docs/.vitepress/cache | ||
/.vitepress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# XJTU-RMV | ||
|
||
XJTU 视觉组 公开教程。 | ||
|
||
## 本地部署与调试 | ||
|
||
安装 [Node.js](https://nodejs.org/zh-cn)/[Git](https://git-scm.com/)。 | ||
|
||
```shell | ||
git clone https://github.com/XJTU-RMV/XJTU-RMV.github.io.git | ||
cd XJTU-RMV.github.io | ||
npm install -g pnpm | ||
pnpm i | ||
pnpm dev | ||
``` | ||
|
||
## 编译 PDF | ||
|
||
```shell | ||
pnpm run export-pdf | ||
``` | ||
|
||
不过暂时编译并不是很优雅,导出的 PDF 也并未按照理想的顺序,暂不推荐。 | ||
|
||
## 贡献者 | ||
|
||
<a href="https://github.com/XJTU-RMV/XJTU-RMV.github.io/graphs/contributors"> | ||
<img src="https://contrib.rocks/image?repo=XJTU-RMV/XJTU-RMV.github.io" /> | ||
</a> | ||
|
||
Made with [contrib.rocks](https://contrib.rocks). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import { defineConfig } from 'vitepress' | ||
import { generateSidebar } from 'vitepress-sidebar'; | ||
|
||
const vitepressSidebarOptions = { | ||
/* Options... */ | ||
}; | ||
|
||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
appearance: false, | ||
markdown: { | ||
image: { | ||
lazyLoading: true | ||
}, | ||
math: true | ||
}, | ||
vite: { | ||
optimizeDeps: { | ||
exclude: [ | ||
'@nolebase/vitepress-plugin-enhanced-readabilities/client', | ||
], | ||
}, | ||
ssr: { | ||
noExternal: [ | ||
// 如果还有别的依赖需要添加的话,并排填写和配置到这里即可 | ||
'@nolebase/vitepress-plugin-enhanced-readabilities', | ||
], | ||
}, | ||
}, | ||
lastUpdated: true, | ||
lang: 'zh-CN', | ||
base: '/', | ||
title: "CSBAOYAN2025", | ||
description: "CSBAOYAN2025", | ||
themeConfig: { | ||
sidebarMenuLabel:'目录', | ||
returnToTopLabel:'返回顶部', | ||
lastUpdated: { | ||
text: '上次更新于', | ||
formatOptions: { | ||
dateStyle: 'full', | ||
timeStyle: 'medium' | ||
}, | ||
}, | ||
footer: { | ||
// message: 'Released under the MIT License.', | ||
copyright: 'Copyright © 2024-present CSBAOYAN', | ||
}, | ||
docFooter: { | ||
prev: '上一页', | ||
next: '下一页', | ||
}, | ||
editLink: { | ||
pattern: 'https://github.com/CS-BAOYAN/CS-BAOYAN-2025/edit/main/docs/:path', // 改成自己的仓库 | ||
text: '在GitHub编辑本页' | ||
}, | ||
outline: { | ||
level: [2,10], // 显示2-6级标题 | ||
label: '目录' // 文字显示 | ||
}, | ||
search: { | ||
provider: 'local' | ||
}, | ||
logo: { | ||
src: '/logo.png', | ||
alt: 'Logo: CSBAOYAN', | ||
}, | ||
siteTitle: false, //标题隐藏 | ||
nav: [ | ||
{ text: 'Home', link: '/' }, | ||
{ text: '关于我们', link: '/关于我们' }, | ||
{ text: '贡献指南', link: '/贡献指南' }, | ||
{ text: '保研真题', link: '/保研真题/' }, | ||
{ text: '保研经验贴', link: '/保研经验贴/' }, | ||
{ text: '填报指南', link: '/填报指南/' }, | ||
{ text: '复习资料', link: '/复习资料/' }, | ||
{ text: '导师推荐', link: '/导师推荐/' }, | ||
{ text: '文书准备', link: '/文书准备/' }, | ||
{ text: '视频资料', link: '/视频资料/' }, | ||
{ text: '院校解析', link: '/院校解析/' }, | ||
], | ||
|
||
sidebar: generateSidebar({ | ||
documentRootPath: '/docs', | ||
useFolderLinkFromIndexFile: true, | ||
manualSortFileNameByPriority: ['关于我们.md', '贡献指南.md', 'second', 'third.md'], | ||
useTitleFromFileHeading: true, | ||
}), | ||
|
||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/CS-BAOYAN/CS-BAOYAN-2025' } | ||
] | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!-- .vitepress/theme/Layout.vue --> | ||
|
||
<script setup lang="ts"> | ||
import { useData } from 'vitepress' | ||
import DefaultTheme from 'vitepress/theme' | ||
import { nextTick, provide } from 'vue' | ||
|
||
const { isDark } = useData() | ||
|
||
const enableTransitions = () => | ||
'startViewTransition' in document && | ||
window.matchMedia('(prefers-reduced-motion: no-preference)').matches | ||
|
||
provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => { | ||
if (!enableTransitions()) { | ||
isDark.value = !isDark.value | ||
return | ||
} | ||
|
||
const clipPath = [ | ||
`circle(0px at ${x}px ${y}px)`, | ||
`circle(${Math.hypot( | ||
Math.max(x, innerWidth - x), | ||
Math.max(y, innerHeight - y) | ||
)}px at ${x}px ${y}px)` | ||
] | ||
|
||
await document.startViewTransition(async () => { | ||
isDark.value = !isDark.value | ||
await nextTick() | ||
}).ready | ||
|
||
document.documentElement.animate( | ||
{ clipPath: isDark.value ? clipPath.reverse() : clipPath }, | ||
{ | ||
duration: 300, | ||
easing: 'ease-in', | ||
pseudoElement: `::view-transition-${isDark.value ? 'old' : 'new'}(root)` | ||
} | ||
) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<DefaultTheme.Layout /> | ||
</template> | ||
|
||
<style> | ||
::view-transition-old(root), | ||
::view-transition-new(root) { | ||
animation: none; | ||
mix-blend-mode: normal; | ||
} | ||
|
||
::view-transition-old(root), | ||
.dark::view-transition-new(root) { | ||
z-index: 1; | ||
} | ||
|
||
::view-transition-new(root), | ||
.dark::view-transition-old(root) { | ||
z-index: 9999; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// https://vitepress.dev/guide/custom-theme | ||
import { h } from 'vue' | ||
import type { Theme } from 'vitepress' | ||
import DefaultTheme from 'vitepress/theme' | ||
import giscusTalk from 'vitepress-plugin-comment-with-giscus'; | ||
import { useData, useRoute } from 'vitepress'; | ||
import googleAnalytics from 'vitepress-plugin-google-analytics' | ||
import "./components/Layout.vue" | ||
import { inBrowser } from 'vitepress' | ||
import busuanzi from 'busuanzi.pure.js' | ||
|
||
import { | ||
NolebaseEnhancedReadabilitiesMenu, | ||
NolebaseEnhancedReadabilitiesPlugin, | ||
NolebaseEnhancedReadabilitiesScreenMenu, | ||
} from '@nolebase/vitepress-plugin-enhanced-readabilities/client' | ||
|
||
import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css' | ||
|
||
import './style.css' | ||
|
||
export default { | ||
extends: DefaultTheme, | ||
setup() { | ||
// Get frontmatter and route | ||
const { frontmatter } = useData(); | ||
const route = useRoute(); | ||
|
||
// giscus配置 | ||
giscusTalk({ | ||
repo: 'XJTU-RMV/XJTU-RMV.github.io', //仓库 | ||
repoId: 'R_kgDOMqXVEA', //仓库ID | ||
category: 'Announcements', // 讨论分类 | ||
categoryId: 'DIC_kwDOMqXVEM4CiDzM', //讨论分类ID | ||
mapping: 'pathname', | ||
inputPosition: 'bottom', | ||
lang: 'zh-CN', | ||
}, | ||
{ | ||
frontmatter, route | ||
}, | ||
//默认值为true,表示已启用,此参数可以忽略; | ||
//如果为false,则表示未启用 | ||
//您可以使用“comment:true”序言在页面上单独启用它 | ||
true | ||
); | ||
}, | ||
Layout: () => { | ||
return h(DefaultTheme.Layout, null, { | ||
// https://vitepress.dev/guide/extending-default-theme#layout-slots | ||
'nav-bar-content-after': () => h(NolebaseEnhancedReadabilitiesMenu), | ||
// 为较窄的屏幕(通常是小于 iPad Mini)添加阅读增强菜单 | ||
'nav-screen-content-after': () => h(NolebaseEnhancedReadabilitiesScreenMenu) | ||
}) | ||
}, | ||
enhanceApp({ app, router, siteData }) { | ||
if (inBrowser) { | ||
router.onAfterRouteChanged = () => { | ||
busuanzi.fetch() | ||
} | ||
} | ||
googleAnalytics({ | ||
id: 'G-Y4NJEXCBER', //跟踪ID,在analytics.google.com注册即可 | ||
}), | ||
app.use(NolebaseEnhancedReadabilitiesPlugin, { | ||
spotlight: { | ||
defaultToggle: true, | ||
}, | ||
}) | ||
} | ||
} satisfies Theme |
Oops, something went wrong.