mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
@@ -686,10 +686,21 @@ func (t *templateHandler) addTemplateFile(name, baseTemplatePath, path string) e
|
||||
}
|
||||
}
|
||||
|
||||
var embeddedTemplatesAliases = map[string][]string{
|
||||
"shortcodes/twitter.html": []string{"shortcodes/tweet.html"},
|
||||
}
|
||||
|
||||
func (t *templateHandler) loadEmbedded() {
|
||||
for _, kv := range embedded.EmbeddedTemplates {
|
||||
// TODO(bep) error handling
|
||||
t.addInternalTemplate(kv[0], kv[1])
|
||||
name, templ := kv[0], kv[1]
|
||||
t.addInternalTemplate(name, templ)
|
||||
if aliases, found := embeddedTemplatesAliases[name]; found {
|
||||
for _, alias := range aliases {
|
||||
t.addInternalTemplate(alias, templ)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user