Files
pivoine.art/layouts/partials/head/json-ld.html
Sebastian Krüger 3bccbdf82d feat: serve audio as local Hugo page resources instead of Jellyfin
Download all 20 track MP3s from Jellyfin and store them as page bundle
resources (track.mp3). Update templates to use .Resources.GetMatch
instead of .Params.audio, removing external API key dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 22:51:30 +01:00

48 lines
1.2 KiB
HTML
Executable File

{{/* 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 }}"
}
{{- with .Resources.GetMatch "track.*" }},
"audio": {
"@type": "AudioObject",
"contentUrl": "{{ .Permalink }}"
}
{{- end }}
{{- if .Params.genre }},
"genre": "{{ .Params.genre }}"
{{- end }}
{{- with .Resources.GetMatch "cover.*" }},
"image": "{{ .Permalink }}"
{{- end }}
}
</script>
{{- end }}