From e4288632856f79952fc25b17ced4895a51f6aefd Mon Sep 17 00:00:00 2001 From: a73x Date: Tue, 27 Aug 2024 20:29:39 +0100 Subject: chore(embed): refactor embed fs --- pages/pages.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pages') diff --git a/pages/pages.go b/pages/pages.go index fbd179a..63c3432 100644 --- a/pages/pages.go +++ b/pages/pages.go @@ -5,9 +5,9 @@ import ( "fmt" "text/template" - "git.sr.ht/~a73x/home" "git.sr.ht/~a73x/home/html" "git.sr.ht/~a73x/home/markdown" + "git.sr.ht/~a73x/home/templates" ) type GlobalState struct { @@ -21,8 +21,8 @@ type ParserPair struct { func renderTemplate(config GlobalState, content markdown.Content) (string, error) { tmpl := content.Meta["template"] - chosenTemplate := fmt.Sprintf("templates/%s.html", tmpl) - t, err := template.ParseFS(home.Content, chosenTemplate, "templates/layouts/*.html") + chosenTemplate := fmt.Sprintf("%s.html", tmpl) + t, err := template.ParseFS(templates.FS, chosenTemplate, "layouts/*.html") if err != nil { return "", fmt.Errorf("failed to parse layouts: %v", err) } -- cgit v1.2.3