feat: random track playback, fix new tracks urls
This commit is contained in:
18
layouts/tracks/list.json.json
Normal file
18
layouts/tracks/list.json.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{{- $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" " ") -}}
|
||||
Reference in New Issue
Block a user