mirror of
https://github.com/m1ngsama/documents.git
synced 2025-12-24 10:51:23 +00:00
fix build
This commit is contained in:
parent
fdc94548ff
commit
065b3f2889
3 changed files with 10 additions and 4 deletions
|
|
@ -14,6 +14,10 @@ export default defineConfig({
|
|||
],
|
||||
|
||||
sidebar: [
|
||||
{
|
||||
text: 'Meeting Minutes',
|
||||
link: '/meetings'
|
||||
},
|
||||
...getMeetingMinutesSidebar()
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ const parseFileName = (fileName: string, link: string): MeetingMinutesParsed =>
|
|||
|
||||
export const getMeetingMinutesSidebar = () => {
|
||||
|
||||
const items = scanDir("meetings")
|
||||
const items = scanDir("meetings").filter(v => {
|
||||
return v.filename != "index.md"
|
||||
})
|
||||
|
||||
const groupedItems = items.reduce((acc, item) => {
|
||||
const parsed = parseFileName(item.filename, item.link)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { readdirSync } from "fs"
|
||||
import { resolve } from "path"
|
||||
import path from "path"
|
||||
|
||||
export const scanDir = (dirname: string) => {
|
||||
const dirpath = resolve(__dirname, `../${dirname}`)
|
||||
const dirpath = path.resolve(__dirname, `../${dirname}`)
|
||||
const res = readdirSync(dirpath)
|
||||
|
||||
const markdownFileNames = res.filter((name) => name.endsWith('.md'))
|
||||
|
|
@ -10,7 +10,7 @@ export const scanDir = (dirname: string) => {
|
|||
return markdownFileNames.map(v => {
|
||||
return {
|
||||
filename: v,
|
||||
link: resolve(dirpath, v)
|
||||
link: path.join(dirpath, v)
|
||||
}
|
||||
})
|
||||
}
|
||||
Loading…
Reference in a new issue