diff --git a/layouts/partials/widgets/projects.html b/layouts/partials/widgets/projects.html index ee58ea3e..e30fdf35 100644 --- a/layouts/partials/widgets/projects.html +++ b/layouts/partials/widgets/projects.html @@ -77,7 +77,7 @@ {{ $.Scratch.Set "project_url" $project.Params.external_link }} {{ $.Scratch.Set "target" "target=\"_blank\"" }} {{ end }} -
+
{{ with $project.Params.image_preview }} {{ if .Get "link"}}{{ end }} - + {{ if .Get "link"}}{{ end }} {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} {{ $figure := split (i18n "figure" | default "Figure %d:") "%d" }} -
{{ if isset .Params "title" }} -

{{ .Get "title" | markdownify | emojify }}

{{ end }} +
+ {{ if isset .Params "title" }}

{{ .Get "title" | markdownify | emojify }}

{{ end }} {{ if or (.Get "caption") (.Get "attr")}}

{{ .Get "caption" | markdownify | emojify }} {{ with .Get "attrlink"}} {{ end }} diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html index 7f7db909..f4d16bcc 100644 --- a/layouts/shortcodes/video.html +++ b/layouts/shortcodes/video.html @@ -1,12 +1,27 @@ -{{ $directory := "img/" }} -{{ $video := printf "%s%s" $directory (.Get "src") }} -{{ $video_type := substr (.Get "src") -1 3 }} -{{ $poster := printf "%s%s%s" $directory (substr (.Get "src") 0 -4) ".jpg" }} -{{ if fileExists (printf "%s%s" "static/" $poster) }} - {{ .Scratch.Set "poster" ($poster | relURL) }} -{{ else }} - {{ .Scratch.Set "poster" "" }} +{{/* Enable video to be loaded from local page dir or media library at `static/img/`. */}} +{{ $path := "" }} +{{ $root_dir := "" }} +{{ if .Get "library" }} + {{ $path = "img/" }} + {{ $root_dir = "static/" }} {{ end }} -