🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

github.com/jorjafox/mod-bs5-lightbox

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/jorjafox/mod-bs5-lightbox

v0.0.6
Source
Go
Version published
Created
Source

Hinode Module - Lightbox for Boostrap 5

A Hugo module for Lightbox for Boostrap 5 that is compatible with Hinode

About

While I can't imagine anyone else wanting to use this, it loads the JS for the lightbox after Bootstrap, which is required for the lightbox to work.

Usage

The module is "optional" per default. In this case the module must be enabled in the frontmatter of the pages that use the lightbox by adding: modules: ["bs5-lightbox"]

To make it work with your images, you need to wrap a URL around it with the following params: data-toggle="lightbox" data-gallery="gallery"

Example:

<a href="{{ $image }}" data-toggle="lightbox" data-gallery="gallery">
    {{- partial "assets/image.html" (dict "url" {{ $image }} "ratio" "1x1" "wrapper" "mx-auto" "class" "img-fluid") -}}
</a>

Shortcode

For the shortcode to content, your front matter must include:

----
modules: ["bs5-lightbox"]
photogallery:
 - /img/path/to/image1.jpg
 - /img/path/to/image2.jpg
----

And in your post content:

{{< bs5-lightbox title="Alt text" >}}

Images should be located in the assets/img folder, and will be resized by Hinode. If you don't use a title, it will use the page title.

Contributing

This module uses semantic-release to automate the release of new versions. The package uses husky and commitlint to ensure commit messages adhere to the Conventional Commits specification. You can run npx git-cz from the terminal to help prepare the commit message.

FAQs

Package last updated on 17 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts