Rend les liens supprimés non cliquables, améliore le rapport des liens morts et accélère la génération du site. Closes #2 Closes #3 Closes #4
25 lines
1.1 KiB
HTML
25 lines
1.1 KiB
HTML
{{- $soundData := .Get 0 -}}
|
|
{{- $dataFile := .Page.Resources.Get (printf "data/sounds/%s.yaml" $soundData) -}}
|
|
{{- if $dataFile -}}
|
|
{{- $data := $dataFile.Content | transform.Unmarshal -}}
|
|
{{- $audio := .Page.Resources.Get $data.file -}}
|
|
{{- if $audio -}}
|
|
<figure>
|
|
<audio controls preload="metadata">
|
|
<source src="{{ $audio.RelPermalink }}">
|
|
Votre navigateur ne prend pas en charge la lecture audio.
|
|
</audio>
|
|
{{- if or $data.title (or $data.description $data.attribution) -}}
|
|
<figcaption>
|
|
{{- with $data.title -}}<p><strong>{{ . }}</strong></p>{{- end -}}
|
|
{{- with $data.description -}}<p>{{ . | markdownify }}</p>{{- end -}}
|
|
{{- with $data.attribution -}}
|
|
{{- $attribution := partial "media/parse-attribution.html" . -}}
|
|
<p><strong>Attribution :</strong> <em>{{- if index $attribution "isURL" -}}{{ partial "render/link.html" (dict "Destination" (index $attribution "url") "Page" $.Page "Text" (index $attribution "label")) }}{{- else -}}{{ . | markdownify }}{{- end -}}</em></p>
|
|
{{- end -}}
|
|
</figcaption>
|
|
{{- end -}}
|
|
</figure>
|
|
{{- end -}}
|
|
{{- end -}}
|