This commit is contained in:
2026-06-10 21:35:28 -04:00
parent 3e80ce78a0
commit 6bf1b87207
7 changed files with 183 additions and 88 deletions
+12 -1
View File
@@ -16,7 +16,18 @@ Get-ChildItem -Path $src -Filter "*.md" | ForEach-Object {
Copy-Item $_.FullName (Join-Path $dst "$slug.md")
$entries += @{ slug = $slug; title = $base }
$category = $null
$content = Get-Content $_.FullName -Raw
if ($content -match '(?s)^---\s*\n(.*?)\n---') {
$frontmatter = $Matches[1]
if ($frontmatter -match '(?m)^category:\s*(.+)$') {
$category = $Matches[1].Trim().Trim('"')
}
}
$entry = @{ slug = $slug; title = $base }
if ($category) { $entry.category = $category }
$entries += $entry
}
$indexPath = "$PSScriptRoot\wwwroot\docs\notes-index.json"