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
42 lines
1.8 KiB
HTML
42 lines
1.8 KiB
HTML
{{- $videoData := .Get 0 -}}
|
|
{{- $dataFile := .Page.Resources.Get (printf "data/videos/%s.yaml" $videoData) -}}
|
|
{{- if $dataFile -}}
|
|
{{- $data := $dataFile.Content | transform.Unmarshal -}}
|
|
{{- $video := .Page.Resources.Get $data.file -}}
|
|
{{- if $video -}}
|
|
{{- $hasMeta := or $data.title (or $data.description (or $data.attribution $data.prompt)) -}}
|
|
<figure class="figure-media{{ if $hasMeta }} figure-media-with-meta{{ else }} figure-media-without-meta{{ end }}">
|
|
<video controls preload="metadata" width="100%">
|
|
<source src="{{ $video.RelPermalink }}" type="video/mp4">
|
|
Votre navigateur ne prend pas en charge la lecture des videos.
|
|
</video>
|
|
{{- if $hasMeta -}}
|
|
<figcaption class="figure-media-meta cover-meta">
|
|
<div class="figure-media-meta-main">
|
|
{{- with $data.title -}}
|
|
<p class="figure-title cover-title">{{ . | markdownify }}</p>
|
|
{{- end -}}
|
|
{{- with $data.description -}}
|
|
<p class="figure-description cover-description">{{ . | markdownify }}</p>
|
|
{{- end -}}
|
|
</div>
|
|
{{- if or $data.attribution $data.prompt -}}
|
|
<div class="figure-media-meta-extra">
|
|
{{- with $data.attribution -}}
|
|
{{- $attribution := partial "media/parse-attribution.html" . -}}
|
|
<p class="figure-attribution cover-attribution"><strong>Attribution :</strong> <span>{{- if index $attribution "isURL" -}}{{ partial "render/link.html" (dict "Destination" (index $attribution "url") "Page" $.Page "Text" (index $attribution "label")) }}{{- else -}}{{ . | markdownify }}{{- end -}}</span></p>
|
|
{{- end -}}
|
|
{{- with $data.prompt -}}
|
|
<details>
|
|
<summary>Prompt</summary>
|
|
<p>{{ . | markdownify }}</p>
|
|
</details>
|
|
{{- end -}}
|
|
</div>
|
|
{{- end -}}
|
|
</figcaption>
|
|
{{- end -}}
|
|
</figure>
|
|
{{- end -}}
|
|
{{- end -}}
|