diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-06-18 11:27:27 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-06-18 11:55:00 +0300 |
commit | 93aad3c543828efca2adeb7f96cf50ae29878593 (patch) | |
tree | 6a3dd4f6f878f8f36be9cef03a15b78b19d1f3da /create/content_template_handler.go | |
parent | 5af045ebab109d3e5501b8b6d9fd448840c96c9a (diff) |
Split out the puthe path/filepath functions into common/paths
So they can be used from the config package without cyclic troubles.
Updates #8654
Diffstat (limited to 'create/content_template_handler.go')
-rw-r--r-- | create/content_template_handler.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/create/content_template_handler.go b/create/content_template_handler.go index 3e9701e4b..09cf4c0a5 100644 --- a/create/content_template_handler.go +++ b/create/content_template_handler.go @@ -20,6 +20,8 @@ import ( "strings" "time" + "github.com/gohugoio/hugo/common/paths" + "github.com/pkg/errors" "github.com/gohugoio/hugo/helpers" @@ -129,7 +131,7 @@ func executeArcheTypeAsTemplate(s *hugolib.Site, name, kind, targetPath, archety // Reuse the Hugo template setup to get the template funcs properly set up. templateHandler := s.Deps.Tmpl().(tpl.TemplateManager) - templateName := helpers.Filename(archetypeFilename) + templateName := paths.Filename(archetypeFilename) if err := templateHandler.AddTemplate("_text/"+templateName, string(archetypeTemplate)); err != nil { return nil, errors.Wrapf(err, "Failed to parse archetype file %q:", archetypeFilename) } |