diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-02-25 21:40:02 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-04-07 21:59:20 +0200 |
commit | 2f721f8ec69c52202815cd1b543ca4bf535c0901 (patch) | |
tree | cae7d1ee9ce867a4bffc70e94513f09e2aebe162 /tpl | |
parent | 8568928aa8e82a6bd7de4555c3703d8835fbd25b (diff) |
Add basic "post resource publish support"
Fixes #7146
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/resources/resources.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tpl/resources/resources.go b/tpl/resources/resources.go index a1055632c..90fb58b4b 100644 --- a/tpl/resources/resources.go +++ b/tpl/resources/resources.go @@ -19,6 +19,8 @@ import ( "fmt" "path/filepath" + "github.com/gohugoio/hugo/resources/postpub" + "github.com/gohugoio/hugo/common/maps" "github.com/gohugoio/hugo/deps" "github.com/gohugoio/hugo/resources" @@ -273,6 +275,10 @@ func (ns *Namespace) PostCSS(args ...interface{}) (resource.Resource, error) { return ns.postcssClient.Process(r, options) } +func (ns *Namespace) PostProcess(r resource.Resource) (postpub.PostPublishedResource, error) { + return ns.deps.ResourceSpec.PostProcess(r) +} + // We allow string or a map as the first argument in some cases. func (ns *Namespace) resolveIfFirstArgIsString(args []interface{}) (resources.ResourceTransformer, string, bool) { if len(args) != 2 { |