🗃️ Removed template.FuncMap setup from theme repository

This commit is contained in:
Maxim Lebedev 2023-11-09 07:52:51 +06:00
parent db68a8d768
commit df55414167
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 2 additions and 8 deletions

View File

@ -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) {