mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 06:58:28 -04:00
48 lines
1.6 KiB
HTML
48 lines
1.6 KiB
HTML
{{- $imagePath := "null" -}}
|
|
|
|
{{- if .Params.image }}
|
|
{{ $imagePath = (printf "%s%s%s%s" "content" (.OutputFormats.Get "html").RelPermalink "images/" .Params.image ) }}
|
|
{{- else }}
|
|
{{ $imagePath = "content/me_large.jpg" }}
|
|
{{- end -}}
|
|
|
|
{{- $imageResource := resources.Get $imagePath }}
|
|
{{- .Scratch.Set "image" $imageResource }}
|
|
{{- $image := .Scratch.Get "image" -}}
|
|
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context": "http://schema.org",
|
|
"@type": "BlogPosting",
|
|
"url": {{ with .OutputFormats.Get "html" }}{{ .Permalink }}{{ end }},
|
|
"mainEntityOfPage": {{ with .OutputFormats.Get "html" }}{{ .Permalink }}{{ end }},
|
|
"name": {{ .Title }},
|
|
"headline": {{ .Title }},
|
|
"datePublished": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" }},
|
|
"dateModified": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" }},
|
|
"keywords": {{ with .Params.tags }}{{ delimit . ", " }}{{ end }},
|
|
"description": {{ if .Description }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }},
|
|
"wordCount": "{{ .WordCount }}",
|
|
"author": {
|
|
"@id": "https://jarv.is/#author"
|
|
},
|
|
"publisher": {
|
|
"@type": "Organization",
|
|
"name": {{ .Site.Author.name }},
|
|
"url": {{ .Site.BaseURL }},
|
|
"logo": {
|
|
"@type": "ImageObject",
|
|
"url": {{ "logo.png" | absURL }},
|
|
"width": "2048",
|
|
"height": "2048"
|
|
}
|
|
},
|
|
"image": {
|
|
"@type": "ImageObject",
|
|
"url": {{ if .Params.image }}{{ (printf "%s%s%s" (.OutputFormats.Get "html").Permalink "images/" .Params.image ) }}{{ else }}{{ "me_large.jpg" | absURL }}{{ end }},
|
|
"width": "{{ $image.Width }}",
|
|
"height": "{{ $image.Height }}"
|
|
}
|
|
}
|
|
</script>
|