My personal website built with Hugo https://mehl.mx
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
727 B

{{- $type := .Get "type" -}} <!-- e.g. "media" -->
{{- $data := .Site.Data.links -}}
{{- if $type -}}
{{- $data = where $data "type" $type -}}
{{ end }}
{{- range sort $data "date" "desc" }}
<ul>
<li>{{.desc}} –
{{- $len := (len .links) -}} <!-- amount of elements under .links -->
{{- range $index, $element := .links -}} <!-- range over links, but keep index -->
<a href="{{.href}}">{{.text}}</a>
{{- if ne (add $index 1) $len -}}, {{- end -}} <!-- only append comma if not last element (index starts with 0) -->
{{- end -}}
{{- with .date }} ({{.}}){{ end }}
{{ range .tags }}<span class="label label-success">{{ . }}</span>&nbsp;{{ end }}
</li>
</ul>
{{ end }}