mirror of
https://github.com/sbrow/thor.git
synced 2026-08-26 11:23:32 -04:00
fix: Fixed a bug with template selection.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
+1
-1
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user