diff --git a/mixtape.tmpl b/mixtape.tmpl index a2503bc..35310ac 100644 --- a/mixtape.tmpl +++ b/mixtape.tmpl @@ -14,13 +14,31 @@ #playlist li { margin: 0.5em 0; } + li p { + display: none; + font-style: italic; + } li.active a { font-weight: bold; } + li.active p { + display: block; + } {{template "full-player" .Tracks}} +{{end}} + +{{define "track-info"}} + {{if eq .Num 1}} +

[Here I might introduce this mix.]

+

[Some notes about track 1.]

+ {{else if eq .Num 2}} +

[Some notes about track 2.]

+ {{else if eq .Num 5}} +

[Some notes about track 5.]

+ {{end}} {{end}} \ No newline at end of file diff --git a/templates.go b/templates.go index bdc56e1..9efdb78 100644 --- a/templates.go +++ b/templates.go @@ -34,15 +34,33 @@ var files = map[string]string{ #playlist li { margin: 0.5em 0; } + li p { + display: none; + font-style: italic; + } li.active a { font-weight: bold; } + li.active p { + display: block; + } {{template "full-player" .Tracks}} +{{end}} + +{{define "track-info"}} + {{if eq .Num 1}} +

[Here I might introduce this mix.]

+

[Some notes about track 1.]

+ {{else if eq .Num 2}} +

[Some notes about track 2.]

+ {{else if eq .Num 5}} +

[Some notes about track 5.]

+ {{end}} {{end}}`, "templates/parts.tmpl": `{{define "player"}} {{with $x := index . 0}} @@ -56,11 +74,14 @@ var files = map[string]string{ {{range $i, $el := .}} {{$el.Artist}} - {{$el.Title}} + {{template "track-info" $el}} {{end}} {{end}} +{{define "track-info"}}{{end}} + {{define "full-player"}} {{template "player" .}} {{template "playlist" .}} diff --git a/templates/parts.tmpl b/templates/parts.tmpl index 2074e9b..408fc5a 100644 --- a/templates/parts.tmpl +++ b/templates/parts.tmpl @@ -10,11 +10,14 @@ {{range $i, $el := .}} {{$el.Artist}} - {{$el.Title}} + {{template "track-info" $el}} {{end}} {{end}} +{{define "track-info"}}{{end}} + {{define "full-player"}} {{template "player" .}} {{template "playlist" .}}