Rendering error with tbiering's hugo-slider-shortcode

Source code repository: github.com/matthh9797/gypsy_lulu/tree/add_feature_personalise_articles

I am attempting to use tbiering’s hugo-slider-shortcode, there is no error when serving the site but the slider does not render on the webpage.

Steps:

  1. Add gallery-slider.html code to layouts/shortcodes.
  2. Create new post (have added an article content/post/test-slider.md for the example)
  3. Insert the following line of code:
    {{< gallery-slider dir="/test/" >}}
  4. Add some images to the static/test/ directory
  5. Run hugo server -D

I am struggling to understand why no images are generated and would greatly appreciate some help. Thanks for your time!

It looks like you tried to format layouts/shortcodes/gallery-slider.html as JavaScript… or something. The file in your repository is nothing like this:

https://github.com/tbiering/hugo-slider-shortcode/blob/master/shortcodes/gallery-slider.html

If I use the untainted file in your test site, it works fine.

That shortcode hasn’t been touched in years, and the project has been abandoned. I’m sure there are better options.

Hi jmooring, thanks for your help! I have discovered that when I save the file my editor formats the code differently and it does not work as shown in this commit.

Please let me know if you know of any better options for image slider shortcodes as I struggled to find anything else.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.