🐛 Fixed double subtitute partials directory

This commit is contained in:
Maxim Lebedev 2023-11-09 08:48:09 +06:00
parent 4365d1fa11
commit 33aaab41a2
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 1 additions and 6 deletions

View File

@ -89,17 +89,12 @@ func main() {
ctx := context.Background()
themeDir := os.DirFS(config.ThemeDir)
partialsDir, err := fs.Sub(themeDir, "partials")
if err != nil {
logger.Fatalln("cannot subtitute theme directory to partials subdirectory:", err)
}
contentDir := os.DirFS(config.ContentDir)
statics := staticfsrepo.NewFileServerStaticRepository(contentDir)
sites := sitefsrepo.NewFileSystemSiteRepository(contentDir)
siter := siteucase.NewSiteUseCase(sites, statics)
funcMap, err := templateutil.New(partialsDir, siter)
funcMap, err := templateutil.New(themeDir, siter)
if err != nil {
logger.Fatalln("cannot setup template.FuncMap for templates: %w", err)
}