feaat: Simplified the template loading code.

This commit is contained in:
Spencer Brower
2026-07-17 11:06:16 -04:00
parent 6694c0cf67
commit fba62fe156
6 changed files with 301 additions and 213 deletions
+2
View File
@@ -12,6 +12,7 @@ Frontmatter :: struct {
draft: bool,
isStarred: bool,
menu: string,
layout: string,
}
// parse_frontmatter splits raw file content into a Frontmatter struct and the
@@ -52,6 +53,7 @@ parse_frontmatter :: proc(content: string) -> (fm: Frontmatter, body: string, ok
fm.draft = json_get_bool(obj, "draft")
fm.isStarred = json_get_bool(obj, "isStarred")
fm.menu = json_get_string(obj, "menu")
fm.layout = json_get_string(obj, "layout")
ok = true
return