1
mirror of https://github.com/jlelse/GoBlog synced 2024-05-30 12:34:27 +00:00
GoBlog/templateStrings.go

20 lines
398 B
Go

package main
import (
"embed"
ts "git.jlel.se/jlelse/template-strings"
)
//go:embed strings/*
var stringsFiles embed.FS
func (a *goBlog) initTemplateStrings() (err error) {
blogLangs := make([]string, 0)
for _, b := range a.cfg.Blogs {
blogLangs = append(blogLangs, b.Lang)
}
a.ts, err = ts.InitTemplateStringsFS(stringsFiles, "strings", ".yaml", "default", blogLangs...)
return err
}