mirror of
https://github.com/ZiuChen/ZiuChen.github.io.git
synced 2025-08-17 06:49:38 +08:00
fix: 侧栏生成规则
This commit is contained in:
parent
7294bbdd21
commit
bf9926dd6a
@ -4,11 +4,8 @@ import path from 'path'
|
||||
export default function generateSideBar() {
|
||||
const articles = fs.readdirSync(path.resolve(__dirname, '../../article'))
|
||||
|
||||
// 排除掉资源文件夹
|
||||
const folders = ['assets']
|
||||
|
||||
const sidebar = articles
|
||||
.filter((article) => !folders.includes(article))
|
||||
.filter((article) => article.endsWith('.md'))
|
||||
.map((article) => {
|
||||
// 移除后缀 `.md`
|
||||
const title = article.replace(/\.md$/, '')
|
||||
|
Loading…
x
Reference in New Issue
Block a user