This commit is contained in:
BaiMeow
2023-07-23 15:07:26 +08:00
21 changed files with 1163 additions and 60 deletions

View File

@@ -4,6 +4,11 @@ import mathjax3 from 'markdown-it-mathjax3';
import { main_sidebar, chapter2, chapter3, chapter4, chapter5, chapter6, chapter7, chapter8, chapter9 } from './sidebar.js';
import { nav } from './nav.js';
import PanguPlugin from 'markdown-it-pangu'
import { createWriteStream } from 'node:fs'
import { resolve } from 'node:path'
import { SitemapStream } from 'sitemap'
const links = []
const customElements = [
'mjx-container',
@@ -152,5 +157,23 @@ export default withMermaid({
},
},
},
transformHtml: (_, id, { pageData }) => {
if (!/[\\/]404\.html$/.test(id))
links.push({
// you might need to change this if not using clean urls mode
url: pageData.relativePath.replace(/((^|\/)index)?\.md$/, '$2'),
lastmod: pageData.lastUpdated
})
},
buildEnd: async ({ outDir }) => {
const sitemap = new SitemapStream({
hostname: 'https://hdu-cs.wiki/'
})
const writeStream = createWriteStream(resolve(outDir, 'sitemap.xml'))
sitemap.pipe(writeStream)
links.forEach((link) => sitemap.write(link))
sitemap.end()
await new Promise((r) => writeStream.on('finish', r))
},
})

View File

@@ -15,6 +15,7 @@ export function nav() {
{ text: '9.计算机网络', link: '9.计算机网络/9.计算机网络' },
]
},
{ text: '博客', link: '/blog/' },
{ text: 'Wiki史', link: '/wiki史' },
{
text: '友链', items:

View File

@@ -23,8 +23,7 @@ export function main_sidebar() {
{ text: '1.9问题专题:好想进入实验室', link: '/1.杭电生存指南/1.9问题专题:好想进入实验室' },
{ text: '1.10如何读论文', link: '/1.杭电生存指南/1.10如何读论文' },
{ text: '1.11陷入虚无主义?进来看看吧', link: '/1.杭电生存指南/1.11陷入虚无主义?进来看看吧' },
{ text: '1.12程序员如何活久一点', link: '/1.杭电生存指南/1.12程序员如何活久一点' },
{ text: '1.13选课原则与抢课技巧', link: '/1.杭电生存指南/1.13选课原则与抢课技巧' },
{ text: '1.12选课原则与抢课技巧', link: '/1.杭电生存指南/1.12选课原则与抢课技巧' },
]
},
{
@@ -652,7 +651,6 @@ export function chapter9() {
collapsed: false,
items: [
{ text: '9.计算机网络', link: '/9.计算机网络/9.计算机网络' },
{ text: '9.1链路层', link: '/9.计算机网络/9.1链路层' },
]
}
]

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -2,10 +2,35 @@
* Customize default theme styling by overriding CSS variables:
* https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
*/
@import url('https://fonts.loli.net/css2?family=Noto+Color+Emoji&family=Noto+Sans+Mono:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');
/**
* Colors
* -------------------------------------------------------------------------- */
@font-face {
font-family: 'Noto Color Emoji';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://gstatic.loli.net/s/notocoloremoji/v25/Yq6P-KqIXTD0t4D9z1ESnKM3-HpFabsE4tq3luCC7p-aXxcn.9.woff2) format('woff2');
unicode-range: U+200d, U+261d, U+2620, U+2639-263a, U+2665, U+270a-270d, U+2728, U+2763-2764, U+2b50, U+fe0f, U+1f31a-1f31f, U+1f32b, U+1f383, U+1f389, U+1f3fb-1f3ff, U+1f440-1f450, U+1f463-1f465, U+1f479-1f47b, U+1f47d-1f480, U+1f485, U+1f48b-1f48c, U+1f493-1f49f, U+1f4a4-1f4a6, U+1f4a8-1f4ab, U+1f4af, U+1f525, U+1f573, U+1f590, U+1f595-1f596, U+1f5a4, U+1f5e3, U+1f600-1f644, U+1f648-1f64a, U+1f64c, U+1f64f, U+1f90c-1f925, U+1f927-1f92f, U+1f932-1f933, U+1f970-1f976, U+1f978-1f97a, U+1f9a0, U+1f9b4-1f9b7, U+1f9bb, U+1f9be-1f9bf, U+1f9d0, U+1f9e0-1f9e1, U+1fa75-1fa79, U+1fac0-1fac2, U+1fae0-1fae6, U+1fae8, U+1faf0-1faf8;
}
@font-face {
font-family: 'Noto Sans SC';
font-weight: 400;
src: url('./font/NotoSansSC-Regular.otf');
}
@font-face {
font-family: 'Noto Sans SC';
font-weight: 700;
src: url('./font/NotoSansSC-Bold.otf');
}
@font-face {
font-family: 'Noto Sans Mono';
font-weight: 400;
src: url('./font/NotoSansMono-Regular.ttf');
}
.dark .vp-doc a,#loading, .dark .vp-doc a>code, .dark .VPNavBarMenuLink.VPNavBarMenuLink:hover, .dark .VPNavBarMenuLink.VPNavBarMenuLink.active, .dark .link.link:hover, .dark .link.link.active, .dark .edit-link-button.edit-link-button, .dark .pager-link .title {
color: var(--vp-c-brand-lighter);