Commit Graph

7 Commits

Author SHA1 Message Date
James Panther 81c6cb9ba6 🐛 Fix incorrect path to partials directory 2025-06-22 15:42:48 +10:00
Matthew Sanabria ab574da6ab layouts: correctly check for template existence
https://github.com/jpanther/congo/commit/4e4b470915171a5855f3f2ea25851995aace8b55
fixed the theme for building with Hugo v0.146.0 or later but it
doesn't correctly check for template existence. That is, if you set
`homepage.layout` to `profile` this theme will still load the `page`
layout.

Hugo's [templates.Exists](https://gohugo.io/functions/templates/exists/)
function tests for the existence of templates relative to the `layouts`
directory. The example code they provide uses `printf` to join the
template name with the `_partials` directory, which would be `partials`
instead for this theme.

```
{{ $partialPath := printf "headers/%s.html" .Type }}
{{ if templates.Exists ( printf "_partials/%s" $partialPath ) }}
  {{ partial $partialPath . }}
{{ else }}
  {{ partial "headers/default.html" . }}
{{ end }}
```
2025-06-21 22:29:16 -04:00
James Panther 4e4b470915 🐛 Fix for templating changes in Hugo v0.146.0 or later
Fixes #1049
2025-06-22 11:10:09 +10:00
James Panther 139706895c ♻️ Move homepage recent articles to partial 2021-08-18 14:35:54 +10:00
James Panther 64dd424b80 Add i18n support 2021-08-17 16:48:08 +10:00
James Panther 7285cac334 Add multiple homepage layouts 2021-08-15 18:41:40 +10:00
James Panther a6a3ee761e 🎉 Initial commit 2021-08-11 15:28:33 +10:00