Introduction du nouveau thème
This commit is contained in:
44
themes/42/layouts/_shortcodes/video.html
Normal file
44
themes/42/layouts/_shortcodes/video.html
Normal file
@@ -0,0 +1,44 @@
|
||||
{{- $videoData := .Get 0 -}}
|
||||
{{- $alignment := .Get 1 | default "center" -}}
|
||||
{{- $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 -}}
|
||||
<figure class="custom-video {{ $alignment }}">
|
||||
<video controls preload="metadata" width="100%">
|
||||
<source src="{{ $video.RelPermalink }}" type="video/mp4">
|
||||
Votre navigateur ne prend pas en charge la lecture des vidéos.
|
||||
</video>
|
||||
{{- if $data.prompt }}
|
||||
<details>
|
||||
<summary>
|
||||
<strong>Attribution :</strong>
|
||||
{{- with $data.attribution }}
|
||||
<em>{{ . | markdownify }}</em>
|
||||
{{- end }}
|
||||
</summary>
|
||||
{{- with $data.prompt }}
|
||||
<p><strong>Prompt :</strong> <em>{{ . }}</em></p>
|
||||
{{- end }}
|
||||
</details>
|
||||
{{- with $data.description }}
|
||||
<figcaption>
|
||||
<p>{{ .| markdownify }}</p>
|
||||
</figcaption>
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- with $data.attribution }}
|
||||
<p class="details">
|
||||
<strong>Attribution :</strong>
|
||||
<em>{{ . | markdownify }}</em>
|
||||
</p>
|
||||
{{- end }}{{- with $data.description }}
|
||||
<figcaption>
|
||||
<p>{{ .| markdownify }}</p>
|
||||
</figcaption>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</figure>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user