do not create an ul for every link
This commit is contained in:
@@ -3,20 +3,20 @@
|
|||||||
{{- if $type -}}
|
{{- if $type -}}
|
||||||
{{- $data = where $data "type" $type -}}
|
{{- $data = where $data "type" $type -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
<ul>
|
||||||
{{- range sort $data "date" "desc" }}
|
{{- range sort $data "date" "desc" }}
|
||||||
<ul>
|
<li>{{.desc}} –
|
||||||
<li>{{.desc}} –
|
{{- $len := (len .links) -}} <!-- amount of elements under .links -->
|
||||||
{{- $len := (len .links) -}} <!-- amount of elements under .links -->
|
{{- range $index, $element := .links -}} <!-- range over links, but keep index -->
|
||||||
{{- range $index, $element := .links -}} <!-- range over links, but keep index -->
|
{{ with .href }}<a href="{{.}}" target="_blank">{{ end }}{{.text}}{{ with .href }}</a>{{end}}
|
||||||
{{ with .href }}<a href="{{.}}" target="_blank">{{ end }}{{.text}}{{ with .href }}</a>{{end}}
|
{{- if ne (add $index 1) $len -}}, {{- end -}} <!-- only append comma if not last element (index starts with 0) -->
|
||||||
{{- if ne (add $index 1) $len -}}, {{- end -}} <!-- only append comma if not last element (index starts with 0) -->
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- if or (.video) (.audio) (.slides) }},{{ end -}}
|
||||||
{{- if or (.video) (.audio) (.slides) }},{{ end -}}
|
{{ with .video }} <a href="{{ . }}" target="_blank" aria-label="Video Recording"><i class="fas fa-video" aria-hidden="true" title="Video Recording"></i></a>{{ end }}
|
||||||
{{ with .video }} <a href="{{ . }}" target="_blank" aria-label="Video Recording"><i class="fas fa-video" aria-hidden="true" title="Video Recording"></i></a>{{ end }}
|
{{- with .audio }} <a href="{{ . }}" target="_blank" aria-label="Audio Recording"><i class="fas fa-microphone" aria-hidden="true" title="Audio Recording"></i></a>{{ end }}
|
||||||
{{- with .audio }} <a href="{{ . }}" target="_blank" aria-label="Audio Recording"><i class="fas fa-microphone" aria-hidden="true" title="Audio Recording"></i></a>{{ end }}
|
{{ with .slides }} <a href="{{ . }}" target="_blank" aria-label="Slides"><i class="fas fa-desktop" aria-hidden="true" title="Slides"></i></a>{{ end -}}
|
||||||
{{ with .slides }} <a href="{{ . }}" target="_blank" aria-label="Slides"><i class="fas fa-desktop" aria-hidden="true" title="Slides"></i></a>{{ end -}}
|
{{- with .date }} ({{.}}){{ end }}
|
||||||
{{- with .date }} ({{.}}){{ end }}
|
{{ range .tags }}<span class="label label-success">{{ . }}</span> {{ end }}
|
||||||
{{ range .tags }}<span class="label label-success">{{ . }}</span> {{ end }}
|
</li>
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user