diff --git a/exampleSite/content/post/2017-03-20-photoswipe-gallery-sample.md b/exampleSite/content/post/2017-03-20-photoswipe-gallery-sample.md index d9b4c74..3daf172 100644 --- a/exampleSite/content/post/2017-03-20-photoswipe-gallery-sample.md +++ b/exampleSite/content/post/2017-03-20-photoswipe-gallery-sample.md @@ -12,7 +12,6 @@ Beautiful Hugo adds a few custom shortcodes created by [Li-Wen Yip](https://www. {{< figure thumb="-thumb" link="/img/sphere.jpg" caption="Sphere" >}} {{< figure thumb="-thumb" link="/img/triangle.jpg" caption="Triangle" alt="This is a long comment about a triangle" >}} {{< /gallery >}} -{{< load-photoswipe >}} ## Example @@ -23,7 +22,6 @@ The above gallery was created using the following shortcodes: {{* figure thumb="-thumb" link="/img/sphere.jpg" caption="Sphere" */>}} {{* figure thumb="-thumb" link="/img/triangle.jpg" caption="Triangle" alt="This is a long comment about a triangle" */>}} {{* /gallery */>}} -{{* load-photoswipe */>}} ``` ## Usage @@ -36,4 +34,4 @@ For full details please see the [hugo-easy-gallery GitHub](https://github.com/li - All the [features/parameters](https://gohugo.io/extras/shortcodes) of Hugo's built-in `figure` shortcode work as normal, i.e. src, link, title, caption, class, attr (attribution), attrlink, alt - `{{* gallery caption-effect="fade" */>}}` will fade in captions for all figures in this gallery instead of the default slide-up behavior - Many gallery styles for captions and hover effects exist; view the [hugo-easy-gallery GitHub](https://github.com/liwenyip/hugo-easy-gallery/) for all options -- Call `{{* load-photoswipe */>}}` **once** anywhere you want on each page where you want to use PhotoSwipe \ No newline at end of file +- Note that this theme will load the photoswipe gallery theme and scripts by default, no need to load photoswipe on your individual pages \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 61e0749..9bd3383 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -54,12 +54,9 @@ - -{{ if ($.Scratch.Get "photoswipeloaded") }} -{{ end }} {{ if .Site.Params.gcse }} - ---> - @@ -71,5 +56,4 @@ Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/ - -{{ end }} \ No newline at end of file + \ No newline at end of file diff --git a/layouts/shortcodes/load-photoswipe.html b/layouts/shortcodes/load-photoswipe.html deleted file mode 100644 index 9eec863..0000000 --- a/layouts/shortcodes/load-photoswipe.html +++ /dev/null @@ -1,71 +0,0 @@ - - - -{{ if not ($.Page.Scratch.Get "photoswipeloaded") }} - {{ $.Page.Scratch.Set "photoswipeloaded" 1 }} - - - - - - - - - - - - -
-{{ end }} \ No newline at end of file diff --git a/static/js/load-photoswipe.js b/static/js/load-photoswipe.js index 5b27e8d..b76ba05 100644 --- a/static/js/load-photoswipe.js +++ b/static/js/load-photoswipe.js @@ -29,7 +29,7 @@ $( document ).ready(function() { title : $title, msrc : $msrc }; - console.log("Using pre-defined dimensions for " + $src); + //console.log("Using pre-defined dimensions for " + $src); // if not, set temp default size then load the image to check actual size } else { var item = { @@ -39,7 +39,7 @@ $( document ).ready(function() { title : $title, msrc : $msrc }; - console.log("Using default dimensions for " + $src); + //console.log("Using default dimensions for " + $src); // load the image to check its dimensions // update the item as soon as w and h are known (check every 30ms) var img = new Image(); @@ -51,7 +51,7 @@ $( document ).ready(function() { clearInterval(wait); item.w = w; item.h = h; - console.log("Got actual dimensions for " + img.src); + //console.log("Got actual dimensions for " + img.src); } }, 30); }