diff options
author | Razon Yang <razonyang@gmail.com> | 2023-12-04 19:05:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 12:05:41 +0100 |
commit | 14d85ec136413dcfc96ad8e4d31633f8f9cbf410 (patch) | |
tree | 24fb956c14c7e075dad9223587cc0aef0a63a0b5 /tpl/tplimpl/template.go | |
parent | 171836cdfae7e9697fddafe262c46b9448bcb98e (diff) |
tpl: Allow using page resources on the images page parameter for `opengraph`, `schema` and `twitter_cards` templates
The page images selection order as follows:
1. Page's images parameter, image resources are supported.
2. Page's image resources that naming in *feature*, *cover* or *thumbnail* pattern.
3. If no page images specified, then the first one of site's images will be used as the fallback, supports site resources.
Diffstat (limited to 'tpl/tplimpl/template.go')
-rw-r--r-- | tpl/tplimpl/template.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tpl/tplimpl/template.go b/tpl/tplimpl/template.go index 96b985cec..053b53b53 100644 --- a/tpl/tplimpl/template.go +++ b/tpl/tplimpl/template.go @@ -751,7 +751,7 @@ func (t *templateHandler) applyTemplateTransformers(ns *templateNamespace, ts *t return c, err } -//go:embed embedded/templates/* +//go:embed all:embedded/templates/* //go:embed embedded/templates/_default/* //go:embed embedded/templates/_server/* var embeddedTemplatesFs embed.FS @@ -779,7 +779,7 @@ func (t *templateHandler) loadEmbedded() error { // For the render hooks and the server templates it does not make sense to preserve the // double _internal double book-keeping, // just add it if its now provided by the user. - if !strings.Contains(path, "_default/_markup") && !strings.HasPrefix(name, "_server/") { + if !strings.Contains(path, "_default/_markup") && !strings.HasPrefix(name, "_server/") && !strings.HasPrefix(name, "partials/_funcs/") { templateName = internalPathPrefix + name } |