An open API service indexing awesome lists of open source software.

https://github.com/anoduck/mod-yagallery

Yet another gallery module for hinode.
https://github.com/anoduck/mod-yagallery

bootstrap gallery hinode hinode-mod hugo images lightbox module

Last synced: 5 months ago
JSON representation

Yet another gallery module for hinode.

Awesome Lists containing this project

README

          

# Hinode Module - yagallery


Yet, another damn gallery module for Hinode.





















## About Hinode

![Logo](https://raw.githubusercontent.com/gethinode/hinode/main/static/img/logo.png)

Hinode is a clean blog theme for [Hugo][hugo], an open-source static site generator. Hinode is available as a [template][repository_template], and a [main theme][repository]. Visit the Hinode documentation site for [installation instructions][hinode_docs].

### _Contributing to Hinode_

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

---

## About Mod-Yagallery

A module for Hinode that uses bootstrap's own modal component to create a photo gallery for sharing images.

## Demo

You can demo all of my hugo modules on [Hinode TestSite](https://testhinode.netlify.com)

## Installation

Since this module was intended for Hinode it uses Hinode's own [bootstrap module](https://github.com/gethinode/mod-bootstrap) to render the styling, and uses Hinode's own
implementation of bootstrap, via the bootstrap module.

## Configuration

Configuration of the module primarily occurs in the yaml file that will be used to store data about your photo gallery.
This method ensures one can have as many galleries as one desires while avoiding the use of global configuration options.

This module supports the following parameters (see the section `params.modules` in `config.toml`):

| Setting | Default | Description |
|---------|---------|---------------------------------------------------|
| debug | false | enable generation of exhaustive debugging output. |

### Yaml Data File

Each gallery is defined using a yaml file located in the folder `/data`, and is identified by the name of that
file less the ".yaml" file extension. For example, if the name of the file is `bananas.yaml`, then the id of your
gallery will be "bananas". Vice versa, if the id of your gallery is "coconut", then the name of the corresponding yaml
file will be `coconut.yaml`.

### Paramters

Below is a table describing the accepted parameters for the yaml data file.

| Label | Type | Values | Description |
|---------|--------|----------------------------|--------------------------------------------------------------|
| title | string | single line string | provides the gallery with a title |
| content | list | yaml object list | used as section header to identify where image entries begin |
| src | string | path | defines path to the image |
| alt | string | single line string | provides the "alt" tag and label |
| thumb | choice | path, "cloudinary", "hugo" | thumbnail method |

#### Example

A typical gallery yaml file will look something like this:

```yaml
title: Gallery of Coconuts
content:
- src: /path/to/coconut1.jpg
alt: "Something about coconuts"
thumb: hugo
- src: /path/to/coconut2.jpg
alt: "Something else about coconuts"
thumb: /path/to/thumb
- src: /path/to/coconut3.jpg
alt: "Even more stuff about coconuts"
thumb: cloudinary
```

You should now get the picture.

## Usage

When it comes time to add your gallery to a page, simply add the shortcode to the markdownfile, including the name of
your datafile less the extension as your gallery id.

```html
{{< yagallery "my-gallery" >}}

<-- or with named parameters -->

{{< yagallery galId="my-gallery" >}}
```

[hugo]: https://gohugo.io
[hinode_docs]: https://gethinode.com

[repository]: https://github.com/gethinode/hinode.git
[repository_template]: https://github.com/gethinode/template.git
[conventionalcommits]: https://www.conventionalcommits.org
[husky]: https://typicode.github.io/husky/
[semantic-release]: https://semantic-release.gitbook.io/