Generate your own online photograph gallery easily.
Here is a live demo: https://soyaine.github.io/horcrux/
Fork this repo, or clone to your local.
$ git clone [email protected]:soyaine/horcrux.git
Make sure you have installed Python3, check current python version.
$ python3 -V
python rather than python3 point to Python3, please change the code in two command file, modify python3 -m venv venv to python -m venv venv.# setup.command / config.command
python -m venv venv
$ brew install python3
$ python3 -V
Change the config in file _config.yml, especially the name, which will shown as the site header and the watermark text in your photos.
name: Horcrux
instagram: your_ins_account_id
Remove all resources under ./photos/, then create folder in it, the folder name will shown as headline of a group of photos. Copy some photos into it.
photos
├── 2019
│ ├── Duo
│ │ ├── 07.jpg
│ │ ├── 08.jpg
│ │ ├── 09.jpg
│ └── Hey
│ ├── 02.jpg
│ └── 1.jpg
└── Mey
├── 02.jpg
└── 1.jpg
⚠️NOTE
Please always keep your own original photo files in other place, because the watermark will change the original one.
When you first try this, just put several photos in, to see wheather you like the watermark effect or not.
Double click the setup.command, the process is doing:
.min.jpgname value set in _config.yml_data/config.jsonRun and greet your gallery in locally by Jekyll.
$ jekyll serve --watch
Git push to the remote branch gh-pages, then it will be online. 🎉
$ git add .
$ git commit -m "init gallery"
$ git push -u origin gh-pages
If you have run successfully locally, here are more details you can reform it. The following is the default settings of Horcrux, almost all config are set in _config.yml:
name: Horcrux # Headline of the page, watermark text
instagram: ins_id
name is both the website headline and the watermark text.# How to process the photos and albums to config
process:
keep_order: True
nested_album:
separator: ' · '
album:
sort_by_time: True # False: sort by filename
order_by: create # other two value can be: access, modify
reverse: True
photo:
sort_by_time: False
order_by: modify
reverse: True
min_width: 600
watermark:
thumbnail: False
original: True
fontsize: 40
fontfamily: Eczar-Medium.ttf
rotate: 0
sort_by_time, order_by, reverse:
photos) by create time, from new to old.keep_order:
order value in JSON under _data, and add new photos or new albums, then double click setup.command, a new config.json file will be generated, all old order set manually will be retained.order without new photo added, you can just double click config.command, which will read all JSON files (Horcrux.json and others under albums folder), and regenerate the config.json file.separator:
photos folder, Horcrux can handle it too../photos/2019/duo/, its displayed title in page will be: DUO · 2019, spliced by separator ·.watermark:
name.frame_padding: 10px # the white gap between photo and outer border
# Widescreen
column: 3
column_gap: 30px
row_gap: 30px
# Smallscreen
small_screen:
column: 2
column_gap: 10px
row_gap: 10px
column:
frame_padding, column_gap, row_gap:
Most of the color palette is defined in ./sass/base.scss, you can change them to your color.
$background: #fafafa;
$surface: #fff;
$title: #5f5f5f;
$subtitle: #868686;
$text: #C8C8C8;
$link: #98A3AA;
$background: whole page's background color$surface: the color of photo square frameThe idea of generating album JSON for using Jekyll and GitHub Pages is inspired by AndyZhang's gallery.
Special thanks to my friend Hugo , the photographs both in the mockup above and in the live demo were taken by him. In the beginning, I just wanted to write a tool for him to share photography. Later I found it can be open-sourced. So there is Horcrux, he named it.
© Soyaine
If you have any question about Horcrux, feel free to start an issue.
You can also reach out to me by email [email protected]
MIT