feat: do not use path as date

This commit is contained in:
2026-04-26 15:10:30 +02:00
parent af9b20485e
commit 34c410b687
7 changed files with 29 additions and 34 deletions
+1 -5
View File
@@ -28,10 +28,6 @@ function readArticleMetadata(path: string): Record<string, string> | null {
const metadata: Record<string, string> = {
path: path.replaceAll('/index.md', ''),
}
const dateMatch = path.match(/(\d{4}\/\d{2}\/\d{2})/)
if (dateMatch && dateMatch[1]) {
metadata['date'] = dateMatch[1].replaceAll('/', '-')
}
do {
subMatch = METADATA_REGEX.exec(match[1])
if (subMatch && subMatch[1] && subMatch[2]) {
@@ -93,7 +89,7 @@ if (!indexContent) {
}
const metadatas = getFiles('articles')
.filter((path) => path.match(/\d{4}\/\d{2}\/\d{2}\/index.md$/))
.filter((path) => path.match(/\/index.md$/))
.map((path) => readArticleMetadata(path))
.filter((metadata) => !!metadata)