🗃️ Removed template.FuncMap setup from theme repository
This commit is contained in:
parent
db68a8d768
commit
df55414167
|
@ -6,7 +6,6 @@ import (
|
|||
"html/template"
|
||||
"io/fs"
|
||||
|
||||
"source.toby3d.me/toby3d/home/internal/templateutil"
|
||||
"source.toby3d.me/toby3d/home/internal/theme"
|
||||
)
|
||||
|
||||
|
@ -15,16 +14,11 @@ type fileSystemThemeRepository struct {
|
|||
funcMap template.FuncMap
|
||||
}
|
||||
|
||||
func NewFileSystemThemeRepository(dir fs.FS) (theme.Repository, error) {
|
||||
funcMap, err := templateutil.New(dir)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot setup template.FuncMap for theme templates: %w", err)
|
||||
}
|
||||
|
||||
func NewFileSystemThemeRepository(dir fs.FS, funcMap template.FuncMap) theme.Repository {
|
||||
return &fileSystemThemeRepository{
|
||||
dir: dir,
|
||||
funcMap: funcMap,
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
func (repo *fileSystemThemeRepository) Get(ctx context.Context) (*template.Template, error) {
|
||||
|
|
Loading…
Reference in New Issue