GjjvdBurg / HugoPhotoSwipe

Command-line tool for easy PhotoSwipe galleries in Hugo
https://gertjanvandenburg.com/blog/hugophotoswipe/
GNU General Public License v3.0
128 stars 15 forks source link

Add option to output albums as branches #31

Open sebastiaan-lampo opened 3 years ago

sebastiaan-lampo commented 3 years ago

Adds a .yml option: generate_branch_bundle If set to true, default behaviour will be changed to produce

This change provides the basis for users who want to use keywords to generate automatic collections of pages using Hugo's taxonomy and have more finetuned control over the data being used to generate the album.

To optimally use this new functionality, the user will need to deploy new list templates and possibly add more detail to the individual photo files. Commit adds minimal documentation to use the functionality.

sebastiaan-lampo commented 3 years ago

This is my first time collaborating on a code project so definitely open for suggestions and feedback.

My goal with this feature is primarily to be able to leverage EXIF tags and Hugo's taxonomy pages. It may be possible to do that with the feature in #24 but I prefer actual pages as they are much easier to edit. I'd call the current feature usable for advanced users. With a bit of template magic I was already able to customize my website where the list template looks for a tag "cover" in the photo pages and, if unavailable, falls back to the first photo in the set. Ultimately this feature, especially if coupled with EXIF tag extraction (future development) would allow to push photos from a photo manager to the source gallery, run hps, run hugo and have a re-indexed photo website without any editing of YML files in between.

My intent is to add EXIF reading functionality to dump that into the front matter as a future pull request. To not make matters overly complicated I developed this as much as possible as a separate feature.

In #24 I noted that you were looking for documentation and tests before adding to master. I've added documentation of this feature but don't know what tests you'd be looking for. I couldn't identify any relevant tests in the current code base.