mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-28 15:50:36 +00:00
cleanup image and thumbnail handling
This commit is contained in:
parent
e1ea8a82fe
commit
da6c845d06
@ -1,4 +1,5 @@
|
|||||||
{{ if .IsHome -}}
|
{{ if .IsHome -}}
|
||||||
|
{{ $thumbnail := default (default "brand.svg" .Site.Params.logo) (index .Site.Params.images 0) | absURL }}
|
||||||
<script type="application/ld+json">
|
<script type="application/ld+json">
|
||||||
{
|
{
|
||||||
"@context": "http://schema.org",
|
"@context": "http://schema.org",
|
||||||
@ -11,7 +12,7 @@
|
|||||||
{{- with .Site.Params.description }}
|
{{- with .Site.Params.description }}
|
||||||
"description": "{{ . }}",
|
"description": "{{ . }}",
|
||||||
{{- end }}
|
{{- end }}
|
||||||
"thumbnailUrl": "{{ (default "brand.svg" .Site.Params.logo) | absURL }}"
|
"thumbnailUrl": "{{ $thumbnail }}"
|
||||||
{{- with .Site.Params.GeekblogContentLicense }},
|
{{- with .Site.Params.GeekblogContentLicense }},
|
||||||
"license": "{{ .name }}"
|
"license": "{{ .name }}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@ -19,7 +20,6 @@
|
|||||||
</script>
|
</script>
|
||||||
{{ else if .IsPage }}
|
{{ else if .IsPage }}
|
||||||
{{ $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors }}
|
{{ $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors }}
|
||||||
{{ $images := default (slice (default "brand.svg" .Site.Params.logo)) .Params.images }}
|
|
||||||
{{ $description := default .Site.Params.description (default .Description .Summary) }}
|
{{ $description := default .Site.Params.description (default .Description .Summary) }}
|
||||||
{{ $ac := 0 }}
|
{{ $ac := 0 }}
|
||||||
{{ $ac_max := default 0 (len $authors) }}
|
{{ $ac_max := default 0 (len $authors) }}
|
||||||
@ -68,7 +68,13 @@
|
|||||||
"height":"32"
|
"height":"32"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"image": [{{ range $i, $image := $images }}{{ if $i }}, {{ end }}{{ $image | absURL }}{{ end }}],
|
{{- with $images := $.Resources.ByType "image" }}
|
||||||
|
"image": [ {{ range $i, $image := $images }}{{ if $i }}, {{ end }}"{{ $image.Permalink | absURL }}" {{ end }}],
|
||||||
|
{{- else }}
|
||||||
|
{{- with $images := .Params.images }}
|
||||||
|
"image": [ {{ range $i, $image := $images }}{{ if $i }}, {{ end }}"{{ $image | absURL }}" {{ end }}],
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
"url" : "{{ .Permalink }}",
|
"url" : "{{ .Permalink }}",
|
||||||
"wordCount" : "{{ .WordCount }}",
|
"wordCount" : "{{ .WordCount }}",
|
||||||
"genre" : [ {{ range $i, $tag := .Params.tags }}{{ if $i }}, {{ end }}"{{ $tag }}" {{ end }}]
|
"genre" : [ {{ range $i, $tag := .Params.tags }}{{ if $i }}, {{ end }}"{{ $tag }}" {{ end }}]
|
||||||
|
Loading…
Reference in New Issue
Block a user