Use absURL to construct image URLs

This commit is contained in:
Yoni 2021-09-26 07:38:55 +03:00
parent 01f9e43e59
commit f5d802b776
2 changed files with 9 additions and 9 deletions

View File

@ -41,9 +41,9 @@
<description>{{ .Summary | html }}</description>
{{ if .Site.Params.fullContents }}<content:encoded>{{ .Content | html }}</content:encoded>{{end}}
{{ if .Params.author }}<dc:creator>{{ .Params.author }}</dc:creator>{{ else if .Site.Params.myname }}<dc:creator>{{ .Site.Params.myname }}</dc:creator>{{end}}
{{ if .Params.image }}<media:content url="{{ .Site.BaseURL }}{{ .Params.image }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ if .Params.featured_image }}<media:content url="{{ .Site.BaseURL }}image/{{ .Params.featured_image }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ if .Params.meta_image }}<media:content url="{{ .Site.BaseURL }}{{ .Params.meta_image }}" medium="image"><media:title type="html">meta image</media:title></media:content>{{end}}
{{ if .Params.image }}<media:content url="{{ .Params.image | absURL }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ if .Params.featured_image }}<media:content url="{{ print "image/" .Params.featured_image | absURL }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ if .Params.meta_image }}<media:content url="{{ .Params.meta_image | absURL }}" medium="image"><media:title type="html">meta image</media:title></media:content>{{end}}
{{ with .Params.tags }}
{{ range . }}
{{ with . }}
@ -81,9 +81,9 @@
<description>{{ .Summary | html }}</description>
{{ if .Site.Params.fullContents }}<content:encoded>{{ .Content | html }}</content:encoded>{{end}}
{{ if .Params.author }}<dc:creator>{{ .Params.author }}</dc:creator>{{ else if .Site.Params.myname }}<dc:creator>{{ .Site.Params.myname }}</dc:creator>{{end}}
{{ if .Params.image }}<media:content url="{{ .Site.BaseURL }}{{ .Params.image }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ if .Params.featured_image }}<media:content url="{{ .Site.BaseURL }}image/{{ .Params.featured_image }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ if .Params.meta_image }}<media:content url="{{ .Site.BaseURL }}{{ .Params.meta_image }}" medium="image"><media:title type="html">meta image</media:title></media:content>{{end}}
{{ if .Params.image }}<media:content url="{{ .Params.image | absURL }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ if .Params.featured_image }}<media:content url="{{ print "image/" .Params.featured_image | absURL }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ if .Params.meta_image }}<media:content url="{{ .Params.meta_image | absURL }}" medium="image"><media:title type="html">meta image</media:title></media:content>{{end}}
{{ with .Params.tags }}
{{ range . }}
{{ with . }}

View File

@ -32,9 +32,9 @@
<description>{{ .Summary | html }}</description>
{{ if .Site.Params.fullContents }}<content:encoded><![CDATA[{{ .Content | html }}]]></content:encoded>{{end}}
{{ if .Params.author }}<dc:creator>{{ .Params.author }}</dc:creator>{{ else if .Site.Params.myname }}<dc:creator>{{ .Site.Params.myname }}</dc:creator>{{end}}
{{ if .Params.image }}<media:content url="{{ .Site.BaseURL }}{{ .Params.image }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ if .Params.featured_image }}<media:content url="{{ .Site.BaseURL }}image/{{ .Params.featured_image }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ if .Params.meta_image }}<media:content url="{{ .Site.BaseURL }}{{ .Params.meta_image }}" medium="image"><media:title type="html">meta image</media:title></media:content>{{end}}
{{ if .Params.image }}<media:content url="{{ .Params.image | absURL }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ if .Params.featured_image }}<media:content url="{{ print "image/" .Params.featured_image | absURL }}" medium="image"><media:title type="html">featured image</media:title></media:content>{{end}}
{{ if .Params.meta_image }}<media:content url="{{ .Params.meta_image | absURL }}" medium="image"><media:title type="html">meta image</media:title></media:content>{{end}}
{{ with .Params.tags }}
{{ range . }}
{{ with . }}