From 6e66709f05b561a7ff31ed77dd489b7f32eb4893 Mon Sep 17 00:00:00 2001 From: Spencer Brower <6729162+sbrow@users.noreply.github.com> Date: Fri, 17 Jul 2026 17:16:21 -0400 Subject: [PATCH] fix: Fixed a bug with template selection. --- TODOS.md | 1 + content.odin | 3 +++ render.odin | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/TODOS.md b/TODOS.md index 28dd1f3..f728cd6 100644 --- a/TODOS.md +++ b/TODOS.md @@ -17,6 +17,7 @@ - [ ] We need to be able to do `Year_Section` in a non-magical, unpriviledged way. - [ ] set opengraph tags / description automatically if unset. (Like hugo does) - [ ] 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 diff --git a/content.odin b/content.odin index 0baa811..df60038 100644 --- a/content.odin +++ b/content.odin @@ -91,6 +91,9 @@ infer_layout :: proc(section: string, is_index: bool) -> string { return fmt.tprintf("%s_index", section) } if section != "" { + if len(section) > 1 && section[len(section) - 1] == 's' { + return section[:len(section) - 1] + } return section } return "page" diff --git a/render.odin b/render.odin index 0e4c72b..5cddc08 100644 --- a/render.odin +++ b/render.odin @@ -144,7 +144,7 @@ get_template :: proc( return tpl } if candidate != chain[n - 1] { - log.warnf("thor: template %s not found, falling back", virtual) + log.debugf("thor: template %s not found, falling back", virtual) } }