gallery slider - fitizens/hugo-modules GitHub Wiki
Gallery and Slider Shortcode
Install Module
Add the following code to your module list in the config/_default/module.toml
file.
[imports](/fitizens/hugo-modules/wiki/imports)
path = "github.com/gethugothemes/hugo-modules/gallery-slider"
Add the following code to your css plugins list in the config.toml
file.
[params.plugins.css](/fitizens/hugo-modules/wiki/params.plugins.css)
link = "plugins/glightbox/glightbox.css"
Add the following code to your js plugins list in the config.toml
file.
[params.plugins.js](/fitizens/hugo-modules/wiki/params.plugins.js)
link = "plugins/glightbox/glightbox.js"
[params.plugins.js](/fitizens/hugo-modules/wiki/params.plugins.js)
link = "js/gallery-slider.js"
Add the following code to your assets/scss/main.scss
or assets/scss/style.scss
file.
@import 'gallery-slider';
Use it as a Partial
Gallery
Available parameters:
Dir
: gallery directoryClass
: gallery custom classHeight
: gallery image processing heightWidth
: gallery image processing widthWebp
: generate webp version | default: trueResize
: image resizer | default: trueCommand
: image resizing command | default: "Fit"Option
: image processing custom optionsZoomable
: image zoomable option | default: true
{{ partial "gallery.html" (dict "Dir" "images/gallery") }}
Slider
Note: You must need to add swiper slider to use this shortcode.
Add the following code to your js plugins list in the config.toml
file.
[params.plugins.js](/fitizens/hugo-modules/wiki/params.plugins.js)
link = "plugins/swiper/swiper-bundle.js"
Add the following code to your css plugins list in the config.toml
file.
[params.plugins.css](/fitizens/hugo-modules/wiki/params.plugins.css)
link = "plugins/swiper/swiper-bundle.css"
Available parameters:
Dir
: gallery directorySrcs
: slice of image URLs (alternative toDir
)Class
: gallery custom classHeight
: gallery image processing heightWidth
: gallery image processing widthWebp
: generate webp version | default: trueResize
: image resizer | default: trueCommand
: image resizing command | default: "Fit"Option
: image processing custom optionsZoomable
: image zoomable option | default: true
{{ partial "slider.html" (dict "Dir" "images/gallery") }}
Use it as a Shortcode
Gallery
Available parameters:
dir
: gallery directoryclass
: gallery custom classheight
: gallery image processing heightwidth
: gallery image processing widthwebp
: generate webp version | default: trueresize
: image resizer | default: truecommand
: image resizing command | default: "Fit"option
: image processing custom optionszoomable
: image zoomable option | default: true
{{< gallery dir="images/gallery">}}
Slider
Note: You must need to add swiper slider to use this shortcode.
Add the following code to your js plugins list in the config.toml
file.
[params.plugins.js](/fitizens/hugo-modules/wiki/params.plugins.js)
link = "plugins/swiper/swiper-bundle.js"
Add the following code to your css plugins list in the config.toml
file.
[params.plugins.css](/fitizens/hugo-modules/wiki/params.plugins.css)
link = "plugins/swiper/swiper-bundle.css"
Available parameters:
dir
: gallery directoryclass
: gallery custom classheight
: gallery image processing heightwidth
: gallery image processing widthwebp
: generate webp version | default: trueresize
: image resizer | default: truecommand
: image resizing command | default: "Fit"option
: image processing custom optionszoomable
: image zoomable option | default: true
{{< slider dir="images/gallery">}}