From 5c689638b10f5de7c223f941cf63e92ad643535f Mon Sep 17 00:00:00 2001 From: Spencer Brower <6729162+sbrow@users.noreply.github.com> Date: Sun, 19 Jul 2026 12:24:14 -0400 Subject: [PATCH] fix: Removed `thor: ` prefixes from log messages. --- TODOS.md | 18 +++++++++++++++++- assets.odin | 6 +++--- content.odin | 4 ++-- frontmatter.odin | 2 +- render.odin | 16 ++++++++-------- site.odin | 4 ++-- 6 files changed, 33 insertions(+), 17 deletions(-) diff --git a/TODOS.md b/TODOS.md index f84e7b3..8ef4f3f 100644 --- a/TODOS.md +++ b/TODOS.md @@ -22,7 +22,12 @@ - [ ] Integrity hash - Allows users to verify their output didn't change after upgrading to a new version - [ ] Content-hash fingerprinting for CSS and JS cache busting +- [ ] Avoid `json.Value` / `json.Object` where possible. +- [ ] running ./thor/thor still logs the debug message: using config /home/spencer/github.com/sbrow.github.io/thor.json + - wrong cwd? - [ ] Clean up the default layouts +- [ ] Add `-production` flag + - sets `-minify` - [ ] Open Graph - [x] mustache data keys for opengraph, etc. - [ ] OpenGraph meta tags — verify all fields match production site @@ -36,7 +41,6 @@ - [ ] Add Opt-in deflist support. - [ ] We need to be able to do `Year_Section` in a non-magical, unprivileged way. See [PLAN.md](PLAN.md) for computed properties approach. - [ ] Table of contents support. -- [ ] prefixing every log message with `thor: ` is silly - [ ] Nav items should be active when the current page is selected. - [ ] Theme selector for syntax highlighting. - use http://github.com/helix-editor/helix/tree/master/runtime/themes) as a @@ -62,6 +66,17 @@ - [ ] warn/error when unknown key used in mustache. - [ ] Import/export packages. Hugo, jekyll, WordPress, etc. +## Notes + +from the [Hugo docs](https://gohugo.io/quick-reference/glossary/#default-sort-order) + +default sort order +: The default sort order for page collections, used when no other criteria are set, follows this priority: + 1. weight (ascending) + 2. date (descending) + 3. linkTitle falling back to title (ascending) + 4. logical path (ascending) + ## Code Review A human should manually review every file in the project. AI cannot complete @@ -86,6 +101,7 @@ these tasks. - [ ] Review markdown.odin - [x] Review sectionate.odin - [x] Review sectionate_test.odin + - [x] Review opengraph.odin - [ ] Review render.odin - [x] Review site.odin - [ ] Review treesitter/treesitter.odin diff --git a/assets.odin b/assets.odin index 7eec12a..3dd2147 100644 --- a/assets.odin +++ b/assets.odin @@ -16,7 +16,7 @@ copy_assets_dir :: proc(vfs: ^VFS, output_dir: string, features: bit_set[Feature if idx := strings.last_index(dest, "/"); idx >= 0 { if err := os.make_directory_all(dest[:idx]); err != nil && err != .Exist { - log.warnf("thor: cannot create %s: %v", dest[:idx], err) + log.warnf("cannot create %s: %v", dest[:idx], err) continue } } @@ -28,11 +28,11 @@ copy_assets_dir :: proc(vfs: ^VFS, output_dir: string, features: bit_set[Feature } } else if entry.data != nil { if err := os.write_entire_file(dest, entry.data); err != nil { - log.warnf("thor: cannot write %s: %v", dest, err) + log.warnf("cannot write %s: %v", dest, err) } } else { if err := os.copy_file(dest, entry.fs_path); err != nil { - log.warnf("thor: cannot copy %s: %v", entry.fs_path, err) + log.warnf("cannot copy %s: %v", entry.fs_path, err) } } } diff --git a/content.odin b/content.odin index 70a3490..7615a08 100644 --- a/content.odin +++ b/content.odin @@ -41,7 +41,7 @@ site_load_content :: proc(site: ^Site) { scan_content :: proc(site: ^Site, dir: string, section: string) { entries, err := os.read_all_directory_by_path(dir, context.allocator) if err != nil { - log.warnf("thor: cannot read %s: %v", dir, err) + log.warnf("cannot read %s: %v", dir, err) return } defer os.file_info_slice_delete(entries, context.allocator) @@ -116,7 +116,7 @@ load_page :: proc( ) { data, err := os.read_entire_file_from_path(file_path, context.allocator) if err != nil { - log.warnf("thor: cannot read %s: %v", file_path, err) + log.warnf("cannot read %s: %v", file_path, err) return } diff --git a/frontmatter.odin b/frontmatter.odin index d299480..7b25031 100644 --- a/frontmatter.odin +++ b/frontmatter.odin @@ -36,7 +36,7 @@ parse_frontmatter :: proc(content: string) -> (fm: Frontmatter, body: string, ok value, err := json.parse_string(json_str, spec = .JSON) if err != nil { - fmt.eprintfln("thor: failed to parse frontmatter JSON: %v", err) + fmt.eprintfln("failed to parse frontmatter JSON: %v", err) return } defer json.destroy_value(value) diff --git a/render.odin b/render.odin index dd1a70b..d9a152b 100644 --- a/render.odin +++ b/render.odin @@ -89,12 +89,12 @@ strip_html_tags :: proc(s: string, allocator := context.allocator) -> string { load_template :: proc(vfs: ^VFS, virtual_path: string) -> mustache.Template { data, ok := vfs_get(vfs, virtual_path) if !ok { - log.warnf("thor: template %s not found", virtual_path) + log.warnf("template %s not found", virtual_path) return mustache.Template{} } tpl, err := mustache.parse(string(data)) if err != nil { - log.warnf("thor: failed to parse template %s: %v", virtual_path, err) + log.warnf("failed to parse template %s: %v", virtual_path, err) } return tpl } @@ -129,11 +129,11 @@ get_template :: proc( return tpl } if candidate != chain[n - 1] { - log.debugf("thor: template %s not found, falling back", virtual) + log.debugf("template %s not found, falling back", virtual) } } - log.errorf("thor: base.html not found in VFS") + log.errorf("base.html not found in VFS") return mustache.Template{} } @@ -154,7 +154,7 @@ render_template :: proc( ) -> string { result, err := mustache.render(content_tpl, data, partials) if err != nil { - fmt.eprintfln("thor: mustache error: %v", err) + fmt.eprintfln("mustache error: %v", err) return "" } return result @@ -389,7 +389,7 @@ load_partials :: proc(vfs: ^VFS) -> map[string]mustache.Template { } tpl, err := mustache.parse(string(data)) if err != nil { - log.warnf("thor: failed to parse partial %s: %v", key, err) + log.warnf("failed to parse partial %s: %v", key, err) continue } partials[key] = tpl @@ -432,7 +432,7 @@ write_page :: proc(output_dir: string, permalink: string, html: string) { dir := fmt.tprintf("%s/%s", output_dir, rel) if err := os.make_directory_all(dir); err != nil && err != .Exist { - fmt.eprintfln("thor: cannot create %s: %v", dir, err) + fmt.eprintfln("cannot create %s: %v", dir, err) return } @@ -442,7 +442,7 @@ write_page :: proc(output_dir: string, permalink: string, html: string) { write_file :: proc(path: string, html: string) { if err := os.write_entire_file_from_string(path, html); err != nil { - fmt.eprintfln("thor: cannot write %s: %v", path, err) + fmt.eprintfln("cannot write %s: %v", path, err) } } diff --git a/site.odin b/site.odin index 07e6a7a..18a1409 100644 --- a/site.odin +++ b/site.odin @@ -85,7 +85,7 @@ init_site :: proc(site: ^Site, args: []string) { found, ok := find_config("thor.json") if ok { path = found - log.debugf("thor: using config %s", path) + log.debugf("using config %s", path) } else { path = "./thor.json" } @@ -121,7 +121,7 @@ load_config_file :: proc( unmarshal_err := json.unmarshal_string(string(data), config, allocator = allocator) if unmarshal_err != nil { - log.warnf("thor: failed to parse %s: %v", path, unmarshal_err) + log.warnf("failed to parse %s: %v", path, unmarshal_err) return false }