You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.6 KiB
49 lines
1.6 KiB
EmlGallery
|
|
==========
|
|
|
|
EmlGallery (elementary Masonry & Lightbox Gallery) is a simple generator for Web
|
|
galleries, based on Masonry, a library that beautifully tiles images on a page,
|
|
and Lightbox, a library for presenting individual images nicely.
|
|
|
|
The Go source is a prototype I did a few years ago and kept here because it's
|
|
fun to me that I used Go at some point!
|
|
|
|
License WTFPLv2.
|
|
|
|
|
|
|
|
Usage
|
|
-----
|
|
|
|
Point the script to a folder with photos and it generates a JSON file with
|
|
metadata, push it alongside your photos to a Web host and you are ready to go.
|
|
|
|
```bash
|
|
$ emlg "/home/dece/Photos/2022 dubious trip to antartica"
|
|
# "Data JSON saved."
|
|
$ ls $!
|
|
# → data.json IMG1.jpg IMG2.jpg IMG3.jpg …
|
|
```
|
|
|
|
The `index.html` file at the root of this repository is able to load the JSON
|
|
data and build the gallery when someone visits your page. There are two ways to
|
|
provide the JSON data to the gallery, explained below but also at the bottom of
|
|
`index.html` itself.
|
|
|
|
### First method: provide data.json as an URL
|
|
|
|
Host the HTML file somewhere and link it with the URL to your data.json as the
|
|
fragment part of the URL (anything after the #).
|
|
|
|
Example: `http://gallery.dece.space/#http://unrelated.host/`
|
|
|
|
This method lets you host only one copy of the gallery page and provide
|
|
different links for each gallery. One drawback is that the server hosting your
|
|
images must have its CORS policy configured to let your browser load the photos.
|
|
|
|
### Second method: embed data.json into the page
|
|
|
|
Override some variables as explained in `index.html` and you should be good to
|
|
go. This method avoids the second request, but as you need to fetch the
|
|
thumbnails anyway…
|