Git Product home page Git Product logo

hugo-slider-shortcode's Introduction

hugo-slider-shortcode

A simple shortcode for hugo to add a gallery slider. It will fetch all images of a specified directory to display as a slideshow.

A live demo with sample images is available.

Installation

Copy the file gallery-slider.html to the /layouts/shortcodes folder of your hugo installation.

Usage

  1. Place the gallery images in a subfolder inside the hugo/static folder (for example hugo/static/img/portfolio).
  2. Inside your content, use the shortcode gallery-slider and pass the subdirectory as the dir-parameter.
{{< gallery-slider dir="/img/portfolio/" >}}

Configuration Parameters

Variable Default Description
dir none Path to image-folder (mandatory)
width 500px Width of the slider area
height 300px Height of the slider area
arrow-left fa-chevron-left Defines the left icon (See info below)
arrow-right fa-chevron-right Defines the right icon
no-fa false Toggles dependency inclusion for FontAwesome
no-jquery false Toggles dependency inclusion for JQuery
auto-slide 0 Set automatic sliding duration in ms

Icons

You may choose any icon from the FontAwesome CSS-classes listed here: http://fontawesome.io/icons/

Examples

<!-- Default use-case -->
{{< gallery-slider dir="/img/portfolio/">}}

<!-- Set width and height -->
{{< gallery-slider dir="/img/portfolio/" width="800px" height="350px" >}}

<!-- Set left and right icon -->
{{< gallery-slider dir="/img/portfolio/" arrow-left="fa-angle-double-left" arrow-right="fa-angle-double-right" >}}

<!-- Set automatic sliding duration -->
{{< gallery-slider dir="/img/portfolio/" auto-slide="2000" >}}

Libraries used

This shortcode automatically loads it's necessary dependencies unless disabled via configuration. Thanks to these awesome libraries:

  • FontAwesome 4.7.0
  • JQuery 1.3.2

License

Licensed under the MIT license.

For futher information see LICENSE.

hugo-slider-shortcode's People

Contributors

comster avatar tbiering avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.