From 180a5c7ac14ca5b4a4e7ac0b8260d18ee4cb6dca Mon Sep 17 00:00:00 2001 From: facundoolano Date: Thu, 15 Feb 2024 15:37:19 -0300 Subject: [PATCH] fix post url generation --- site/site.go | 1 + 1 file changed, 1 insertion(+) diff --git a/site/site.go b/site/site.go index 79deafa..4cd760c 100644 --- a/site/site.go +++ b/site/site.go @@ -98,6 +98,7 @@ func (site *Site) loadTemplates(srcDir string) error { // set site related (?) metadata. Not sure if this should go elsewhere relPath, _ := filepath.Rel(srcDir, path) + relPath = strings.TrimSuffix(relPath, filepath.Ext(relPath)) + templ.Ext() templ.Metadata["path"] = relPath templ.Metadata["url"] = "/" + strings.TrimSuffix(relPath, ".html") templ.Metadata["dir"] = "/" + filepath.Dir(relPath)