mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
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.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user