Socket
Book a DemoInstallSign in
Socket

github.com/icecreammatt/hugo-gallery

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/icecreammatt/hugo-gallery

Source
Go
Version
v0.0.0-20160503053636-0c578355fec5
Version published
Created
Source

This tool will create a new posts directory containing a markdown file for each image in source directory allowing for an ordered slide show.

Usage

hugo-gallery <Source Path> <Destination Section> <Title> [BaseUrl]

Example

hugo-gallery static/images/vacation-photos hawaii "Hawaii Trip"

Visit localhost:1313/hawaii to view the content.

This would read all of the images out of the static/images/vacation-photos directory and create a new folder named hawaii in content/hawaii filled with front matter markdown files. See sample below for details.

Markdown Sample

---
title: Hawaii Trip
date: "2014-11-12"
image_name: images/vacation-photos/IMG_003.jpg
previous_image: images/vacation-photos/IMAGE_002.jpg
next_image: images/vacation-photos/IMAGE_004.jpg
next_post_path: hawaii/IMAGE_004
previous_post_path: hawaii/IMAGE_002
---

Template Usage

Reference image_name in the Hugo single post template
<img src="{{ .Params.image_name }}" />

Todo:

  • Implement test coverage to solution

License

  • MIT

FAQs

Package last updated on 03 May 2016

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