1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 05:38:26 -04:00
jarv.is/layouts/partials/schema-person.html
2019-12-21 11:06:46 -05:00

37 lines
1.2 KiB
HTML

{{- with .Site.Author -}}
{{- $imagePath := "" }}
{{- with $.Site.Params.defaultimage }}
{{- $imagePath = (path.Join "content" .) }}
{{- end }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Person",
"@id": {{ printf "%s%s" $.Site.BaseURL "#author" }},
"name": {{ $.Site.Author.name }},
"url": {{ $.Site.BaseURL }},
"description": {{ $.Site.Params.description }},
{{ with .jobtitle }}"jobTitle": {{ . }},{{ end }}
{{- with (imageConfig $imagePath) }}
"image": {
"@type": "ImageObject",
"url": {{ replace $imagePath "content/" $.Site.BaseURL }},
"width": "{{ .Width }}",
"height": "{{ .Height }}"
},
{{- end }}
"sameAs": [
{{ $.Site.BaseURL }},
{{ with .github }}{{ printf "%s%s" "https://github.com/" . }},{{ end }}
{{ with .twitter }}{{ printf "%s%s" "https://twitter.com/" . }},{{ end }}
{{ with .linkedin }}{{ printf "%s%s%s" "https://www.linkedin.com/in/" . "/" }},{{ end }}
{{ with .facebook }}{{ printf "%s%s" "https://www.facebook.com/" . }},{{ end }}
{{ with .instagram }}{{ printf "%s%s%s" "https://www.instagram.com/" . "/" }},{{ end }}
{{ with .mastodon }}{{ printf "%s%s" "https://" . }}{{ end }}
]
}
</script>
{{- end -}}