1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 07:41:18 -04:00

playing with Scratch to re-use image logic -- still messy but it's progress

This commit is contained in:
2019-12-21 13:17:35 -05:00
parent 762a82b3cb
commit 027725faf1
7 changed files with 47 additions and 37 deletions

View File

@@ -1,8 +1,3 @@
{{- $imagePath := "" }}
{{- with .Params.image }}
{{- $imagePath = (path.Join "content" $.File.Dir "images/" .) }}
{{- end }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
@@ -25,17 +20,16 @@
"url": {{ .Site.BaseURL }},
"logo": {
"@type": "ImageObject",
"url": {{ "logo.png" | absURL }},
"width": "2048",
"height": "2048"
"url": {{ .Scratch.Get "logoImage_url" }},
"width": "{{ .Scratch.Get "logoImage_width" }}",
"height": "{{ .Scratch.Get "logoImage_height" }}"
}
}{{ with (imageConfig $imagePath) }},
},
"image": {
"@type": "ImageObject",
"url": {{ replace $imagePath "content/" $.Site.BaseURL }},
"width": "{{ .Width }}",
"height": "{{ .Height }}"
"url": {{ .Scratch.Get "socialImage_url" }},
"width": "{{ .Scratch.Get "socialImage_width" }}",
"height": "{{ .Scratch.Get "socialImage_height" }}"
}
{{- end }}
}
</script>