diff options
Diffstat (limited to 'tpl/tplimpl/ace.go')
-rw-r--r-- | tpl/tplimpl/ace.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tpl/tplimpl/ace.go b/tpl/tplimpl/ace.go index 6fb4ca439..7a1f849f4 100644 --- a/tpl/tplimpl/ace.go +++ b/tpl/tplimpl/ace.go @@ -1,4 +1,4 @@ -// Copyright 2017-present The Hugo Authors. All rights reserved. +// Copyright 2019 The Hugo Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,7 +14,6 @@ package tplimpl import ( - "html/template" "path/filepath" "strings" @@ -52,15 +51,15 @@ func (t *templateHandler) addAceTemplate(name, basePath, innerPath string, baseC return err } - if err := applyTemplateTransformersToHMLTTemplate(templ); err != nil { + isShort := isShortcode(name) + + info, err := applyTemplateTransformersToHMLTTemplate(isShort, templ) + if err != nil { return err } - if strings.Contains(name, "shortcodes") { - // We need to keep track of one ot the output format's shortcode template - // without knowing the rendering context. - clone := template.Must(templ.Clone()) - t.html.t.AddParseTree(withoutExt, clone.Tree) + if isShort { + t.addShortcodeVariant(name, info, templ) } return nil |