๐ท Static photos gallery made with Preact. Each albums is generated using a script to index the photos and generating the thumbnails.
1. Clone this repo:
git clone https://github.com/maximeborges/gallery.maximeborg.es.git gallery.maximeborg.es
cd gallery.maximeborg.es
2. Install dependencies:
yarn
or (slower)
npm install
3. Add albums:
cp -r ~/Images/My-Album/ ./to_process/
4. Build !:
yarn build
You're done! Now serve the
build
folder from wherever you want!
Since this application use preact-router
, you can access any page with a simple rewrite rule from your reverse-proxy. There is an example using Caddy:
gallery.maximeborg.es {
header / server "AN AMAZING UNICORN"
tls contact@maximeborg.es
root /var/www/gallery.maximeborg.es
gzip
rewrite / {
ext !jpg !jpeg !png
to {path} /
}
}
The extensions line (
ext !jpg !jpeg !png
) in therewrite
section allows to have direct access to images via their URL, and not to be redirected to thehtml
content
The web part of this application is based on preact-boilerplate, you can check out the developement workflow section to get how to work on this project.
The processing of the albums is done with the process.js
file. It's a little bit messy in there but I got it working perfectly for me. If anyone want to imporve it, pull request are welcomed!
MIT