Files
pivoine.art/layouts/partials/head/json-ld.html

48 lines
1.2 KiB
HTML
Raw Normal View History

2025-11-29 17:51:00 +01:00
{{/* Website schema for homepage */}}
{{- if .IsHome }}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "{{ .Site.Title }}",
"url": "{{ .Site.BaseURL }}",
"description": "{{ .Site.Params.description }}",
"author": {
"@type": "Person",
"name": "{{ .Site.Params.author }}",
"email": "{{ .Site.Params.email }}"
}
}
</script>
{{- end }}
{{/* MusicRecording schema for track pages */}}
{{- if and .IsPage (eq .Section "tracks") }}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "MusicRecording",
"name": "{{ .Title }}",
"description": "{{ .Description | default .Summary | plainify }}",
"url": "{{ .Permalink }}",
"datePublished": "{{ .Date.Format "2006-01-02" }}",
"byArtist": {
"@type": "Person",
"name": "{{ .Params.artist | default .Site.Params.author }}"
}
{{- if .Params.audio }},
"audio": {
"@type": "AudioObject",
"contentUrl": "{{ .Params.audio }}"
}
{{- end }}
{{- if .Params.genre }},
"genre": "{{ .Params.genre }}"
{{- end }}
{{- with .Resources.GetMatch "cover.*" }},
"image": "{{ .Permalink }}"
{{- end }}
}
</script>
{{- end }}