Initial commit
This commit is contained in:
47
layouts/partials/head/json-ld.html
Executable file
47
layouts/partials/head/json-ld.html
Executable file
@@ -0,0 +1,47 @@
|
||||
{{/* 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 }}
|
||||
Reference in New Issue
Block a user