mirror of
https://github.com/ZiuChen/ZiuChen.github.io.git
synced 2025-08-18 15:39:35 +08:00
fix: 生成侧边栏时排除资源文件夹
This commit is contained in:
parent
f6fa4975dc
commit
3849a5b3a4
@ -4,7 +4,12 @@ import path from 'path'
|
||||
export default function generateSideBar() {
|
||||
const articles = fs.readdirSync(path.resolve(__dirname, '../../article'))
|
||||
|
||||
const sidebar = articles.map((article) => {
|
||||
// 排除掉资源文件夹
|
||||
const folders = ['assets']
|
||||
|
||||
const sidebar = articles
|
||||
.filter((article) => !folders.includes(article))
|
||||
.map((article) => {
|
||||
// 移除后缀 `.md`
|
||||
const title = article.replace(/\.md$/, '')
|
||||
return {
|
||||
|
Loading…
x
Reference in New Issue
Block a user