• Stars
    star
    211
  • Rank 180,914 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created 10 months ago
  • Updated 23 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Gallery Theme for Hugo

Hugo Gallery Theme

A very simple and opinionated photo gallery theme for Hugo.


Screenshot


Features

  • Responsive design
  • Dark theme
  • Private albums
  • Automatic (or manual) selection of feature images
  • Justified album views with Flickr's Justified Layout
  • Lightbox with PhotoSwipe
  • SEO with Open Graph tags

Installation

This theme is built with Tailwind CSS and requires Hugo >= 0.113, Node.js and NPM.

As a Hugo Module

Requires the Go binary installed.

$ hugo mod init github.com/<your_user>/<your_project>

Then add the theme to your hugo.toml:

[module]
  [[module.imports]]
    path = "github.com/nicokaiser/hugo-theme-gallery/v2"

Install required packages:

$ hugo mod npm pack
$ npm install

As Git Submodule

$ git submodule add --depth=1 https://github.com/nicokaiser/hugo-theme-gallery.git themes/gallery
$ hugo mod npm pack
$ npm install

Usage

Page bundles which contain at least one image are listed as album or gallery:

content/
├── _index.md
├── about.md             <-- not listed in album list
├── animals/
│   ├── _index.md
│   ├── cats/
│   |   ├── index.md
│   |   ├── cat1.jpg
│   |   └── feature.jpg  <-- album thumbnail
│   ├── dogs/
│   |   ├── index.md
│   |   ├── dog1.jpg     <-- album thumbnail
│   |   └── dog2.jpg
│   └── feature.jpg
├── bridge.jpg           <-- site thumbnail (OpenGraph, etc.)
└──  nature/
    ├── index.md         <-- contains `featured_image: images/tree.jpg`
    ├── images/
    |   └── tree.jpg     <-- album thumbnail
    ├── nature1.jpg
    └── nature2.jpg
  • /about.md is not a Page Bundle and does not have image resources. It is not displayed in the album list.
  • /nature is a Leaf Bundle (has index.md and no children) => displayed as gallery (single layout).
  • /animals is a Branch Bundle (has _index.md and has children) => displayed as album list (list layout).
  • The image resource with *feature* in its name or the first image found is used as thumbnail image for album lists.
  • Albums without an image are not shown.

Front matter

  • title -- title of the album, shown in the album list and on the album page.
  • date -- album date, used for sorting (newest first).
  • description -- description shown on the album page.
  • featured_image -- name of the image file used for the album thumbnail. If not set, the first image which contains feature in its filename is used, otherwise the first image in the album.
  • weight -- can be used to adjust sort order.
  • private -- if set to true, this album is not shown in the album overview and is excluded from RSS feeds.
  • featured -- if set to true, this album is listed on the homepage (even if private).
  • sort_by -- property used for sorting images in an album. Default is Name (filename), but can also be Exif.Date (only works if all images have EXIF tags).
  • sort_order -- sort order. Default is asc.

Customization

The theme is very opinionated but kept simple to you can create a customized version. CSS is generated with Tailwind, PostCSS and Hugo Pipes, so you can use additional Tailwind utility classes in your custom templates.

Custom CSS can be used in assets/css/custom.css (see the example in exampleSite).

Author

More Repositories

1

rpi-audio-receiver

Raspberry Pi Audio Receiver with Bluetooth A2DP, AirPlay 2, and Spotify Connect
Shell
1,326
star
2

nginx-websocket-proxy

nginx WebSocket Proxy
340
star
3

Dyndns

A simple DynDNS server in PHP
PHP
99
star
4

node-monit

Node.js services with sysvinit and Monit
Shell
95
star
5

passport-apple

Sign in with Apple strategy for Passport
JavaScript
84
star
6

wamp.io

An implementation of the Autobahn WebSockets RPC/PubSub: WebSocket Application Messaging Protocol (WAMP) for WebSocket.IO or Engine.IO
JavaScript
79
star
7

node-init

A battle-tested solution for respawning node services on SysVinit-based (init.d) systems like Debian.
Shell
15
star
8

docker-koken

Docker container for Koken with Apache and PHP 7
PHP
13
star
9

php-oauth

Andy Smith's OAuth library, refactored for PHP 5.3
PHP
12
star
10

kaiser.gallery

JavaScript
12
star
11

bandoneon

A little JavaScript application that wants to help learning the bandoneon.
Vue
8
star
12

node-dyndns-server

A simple DynDNS server
JavaScript
8
star
13

rpi-camera-import

Raspberry Pi Camera Import
Python
7
star
14

koa-encrypted-session

Encrypted cookie session middleware extension for koa-session
JavaScript
5
star
15

oauth-provider-example

JavaScript
2
star
16

docker-batsd

Docker build file for Batsd (StatsD alternative)
2
star
17

doctrine-sandbox

A simple Sandbox for playing with Doctrine 2
PHP
2
star
18

hugo-gallery-example

Shell
2
star
19

http-status-cats

HTTP Status Cats (not only) for express
JavaScript
2
star
20

check-cert-expiry

Check expiration dates for SSL/TLS hosts
JavaScript
1
star
21

node-flashpolicy

Simple socket policy file server for Node.js
JavaScript
1
star
22

dotfiles

Dotfiles (public)
Shell
1
star