diff options
author | it-gro <13005925+it-gro@users.noreply.github.com> | 2021-08-26 16:24:13 +0300 |
---|---|---|
committer | it-gro <13005925+it-gro@users.noreply.github.com> | 2021-08-26 16:24:13 +0300 |
commit | 3418bbb6f9670b9f5e18e0ff47dcfb165dd38d06 (patch) | |
tree | 6ec31407bcbff003cdde503d08d8eb2634a6c8a3 | |
parent | 6db53ab730be4f43e6b0a15a9983a2c2018081a2 (diff) |
wip
-rw-r--r-- | layouts/shortcodes/res-figure.html | 10 | ||||
-rw-r--r-- | layouts/shortcodes/res-gallery-load-photoswipe.html | 7 | ||||
-rw-r--r-- | static/css/res-gallery.css | 4 |
3 files changed, 15 insertions, 6 deletions
diff --git a/layouts/shortcodes/res-figure.html b/layouts/shortcodes/res-figure.html index 98b0670..1a7f079 100644 --- a/layouts/shortcodes/res-figure.html +++ b/layouts/shortcodes/res-figure.html @@ -101,14 +101,14 @@ <figure class='res-figure no-photoswipe' style="width: {{ $myImage.Width }}px;"> <img src="{{ $myImage.RelPermalink }}" - alt="{{ $myCapFileName }}" - width="{{ $myImage.Width }}" height="{{ $myImage.Height }}" + alt="{{ $myCapFileName }}" + width="{{ $myImage.Width }}" height="{{ $myImage.Height }}" > <figcaption class='res-figcaption'> {{- with $.Inner }} - {{- . }} - {{- else }} - {{ $myCaption | safeHTML }} + {{- . | markdownify }} + {{- else -}} + {{- $myCaption | safeHTML -}} {{- end }} </figcaption> </figure> diff --git a/layouts/shortcodes/res-gallery-load-photoswipe.html b/layouts/shortcodes/res-gallery-load-photoswipe.html index 3e9f64a..b996016 100644 --- a/layouts/shortcodes/res-gallery-load-photoswipe.html +++ b/layouts/shortcodes/res-gallery-load-photoswipe.html @@ -4,8 +4,10 @@ Inspired by https://github.com/liwenyip/hugo-easy-gallery/ --> <!-- prevent this shortcode from being loaded more than once per page --> */}} + {{- if not ($.Page.Scratch.Get `photoswipeloaded`) }} {{- $.Page.Scratch.Set `photoswipeloaded` 1 }} + {{- /* <!-- *** jQuery must be loaded before load-photoswipe.js *** @@ -19,6 +21,8 @@ Inspired by https://github.com/liwenyip/hugo-easy-gallery/ <script src='{{ .Site.BaseURL }}/vendor/photoswipe/photoswipe.min.js'> </script> <script src='{{ .Site.BaseURL }}/vendor/photoswipe/photoswipe-ui-theme.js'> </script> +<link rel="stylesheet" href='{{ relURL `/css/res-gallery.css` }}' /> + {{- /*<!-- Root element of PhotoSwipe. Must have class pswp. -->*/}} <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true"> {{- /* @@ -72,4 +76,5 @@ Inspired by https://github.com/liwenyip/hugo-easy-gallery/ </div> </div> </div> -{{ end }} + +{{- end }} {{/* not */}} diff --git a/static/css/res-gallery.css b/static/css/res-gallery.css index 0bf886f..5e17ca1 100644 --- a/static/css/res-gallery.css +++ b/static/css/res-gallery.css @@ -83,6 +83,10 @@ figcaption styles cursor: pointer; } +.res-gallery-figcaption a { + color: #FFF; +} + .res-gallery.caption-position-none figcaption { visibility: hidden; bottom: 0; |