19 lines
532 B
JSON
19 lines
532 B
JSON
{{- $tracks := slice -}}
|
|
{{- range .Pages -}}
|
|
{{- $track := dict
|
|
"title" .Title
|
|
"url" .Permalink
|
|
"slug" .File.ContentBaseName
|
|
"audio" .Params.audio
|
|
"duration" .Params.duration
|
|
"genre" .Params.genre
|
|
"image" ""
|
|
-}}
|
|
{{- with .Resources.GetMatch "cover.*" -}}
|
|
{{- $img := .Resize "200x webp q85" -}}
|
|
{{- $track = merge $track (dict "image" $img.RelPermalink) -}}
|
|
{{- end -}}
|
|
{{- $tracks = $tracks | append $track -}}
|
|
{{- end -}}
|
|
{{- dict "tracks" $tracks | jsonify (dict "indent" " ") -}}
|