added check for posts directory

This commit is contained in:
Daniel Fichtinger 2024-12-29 20:06:57 -05:00
parent 63ca2a7b46
commit fb67ef046a
7 changed files with 37 additions and 4 deletions

View file

@ -89,7 +89,8 @@ func buildPageData(m Metadata, in string, out string, settings *Settings) *PageD
p.FooterName = settings.FooterName
p.Footer = settings.Footer
}
if t, ok := m["type"].(string); ok && t == "article" || t == "post" {
// TODO: Don't hard code posts dir name
if t, ok := m["type"].(string); util.InDir(in, "posts") && !ok || (ok && t == "article" || t == "post") {
p.Template = (settings.ArticleTemplate)
} else {
p.Template = (settings.DefaultTemplate)