Skip to content

Various scripts for working with Hugo Static Site Generator

Notifications You must be signed in to change notification settings

ronliskey/hugo_scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

Hugo Scripts

Various scripts for optimizing work with Hugo Static Site Generator.

gallerymaker.sh

Creates a directory of optimized images and thumbnail files for use in Hugo Easy Gallery.

  1. Creates a new gallery drectory. (Will not overwrite existing directories.)
  2. Creates reasonably sized gallery images (default: 1200px wide)
  3. Creates matching thumbnail images (defaut: 300px wide)
  4. Sets read permissions on all gallery images.
  5. Attempts to wipe clean OSX quarantine bits.
  6. Adds an index.html file to the new gallery directory to block index viewing.
  7. Calls the Hugo 'new' command to create a <YOUR_NEW_GALLERY>.md file.

Installaion

  1. Install ImageMagick: https://www.imagemagick.org/script/download.php
  2. Install gallerymaker.sh, and make it executable.
  3. Set default values in gallerymaker.sh.
    • HUGO_ROOT="/path/to/your/hugo/installation/"
    • GALLERY_ROOT="/static/img/gallery" # The directory in which all your galleries are stored.
    • GALLERY_SECTION="gallery" # The Hugo Section used to display galleries.
    • IMAGE_WIDTH=1200
    • THUMB_WIDTH=300

Usage

  1. Create a directory of images for use in your new gallery.
  2. In the terminal, cd into this directory.
  3. Run gallerymaker.sh, such as:
$ gallerymaker.sh [-g my-new-gallery] [-t -thumb] # If in your path
$ ./gallerymaker.sh [-g my-new-gallery] [-t -thumb] # If in the current directory
$ ~/bin/gallerymaker.sh [-g my-new-gallery] [-t -thumb] # If in bin

About

Various scripts for working with Hugo Static Site Generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages