{"id":13572160,"url":"https://github.com/GjjvdBurg/HugoPhotoSwipe","last_synced_at":"2025-04-04T09:31:57.107Z","repository":{"id":44382205,"uuid":"77178105","full_name":"GjjvdBurg/HugoPhotoSwipe","owner":"GjjvdBurg","description":"Command-line tool for easy PhotoSwipe galleries in Hugo","archived":false,"fork":false,"pushed_at":"2023-10-01T22:41:17.000Z","size":6021,"stargazers_count":131,"open_issues_count":9,"forks_count":15,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-02T11:07:31.964Z","etag":null,"topics":["automation","hugo","photo-gallery","photoswipe","python"],"latest_commit_sha":null,"homepage":"https://gertjanvandenburg.com/blog/hugophotoswipe/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GjjvdBurg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-12-22T21:49:31.000Z","updated_at":"2025-03-23T08:50:40.000Z","dependencies_parsed_at":"2022-07-14T13:20:51.564Z","dependency_job_id":"c91a4d5d-3e56-4db2-a8a3-e1e77bafde30","html_url":"https://github.com/GjjvdBurg/HugoPhotoSwipe","commit_stats":{"total_commits":133,"total_committers":6,"mean_commits":"22.166666666666668","dds":0.06015037593984962,"last_synced_commit":"d1b32a6008a102219a22220e62dafbcb5dd42866"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GjjvdBurg%2FHugoPhotoSwipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GjjvdBurg%2FHugoPhotoSwipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GjjvdBurg%2FHugoPhotoSwipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GjjvdBurg%2FHugoPhotoSwipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GjjvdBurg","download_url":"https://codeload.github.com/GjjvdBurg/HugoPhotoSwipe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246802624,"owners_count":20836373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","hugo","photo-gallery","photoswipe","python"],"created_at":"2024-08-01T14:01:15.190Z","updated_at":"2025-04-04T09:31:52.096Z","avatar_url":"https://github.com/GjjvdBurg.png","language":"Python","funding_links":["https://www.buymeacoffee.com/GjjvdBurg"],"categories":["Python"],"sub_categories":[],"readme":"# HugoPhotoSwipe\n\n[![build](https://github.com/GjjvdBurg/HugoPhotoSwipe/actions/workflows/build.yml/badge.svg)](https://github.com/GjjvdBurg/HugoPhotoSwipe/actions/workflows/build.yml)\n[![PyPI version](https://badge.fury.io/py/hugophotoswipe.svg)](https://pypi.org/project/hugophotoswipe)\n[![Downloads](https://pepy.tech/badge/hugophotoswipe)](https://pepy.tech/project/hugophotoswipe)\n\nHugoPhotoSwipe is a command line application to easily create and manage\n[PhotoSwipe](http://photoswipe.com/) albums when using the\n[Hugo](https://gohugo.io/) static website generator.\n\n**Useful links**\n- [Demo page generated with Hugo and using \n  PhotoSwipe](https://gjjvdburg.github.io/HugoPhotoSwipe-Demo/)\n- [Demo page source code](https://github.com/GjjvdBurg/HugoPhotoSwipe-Demo)\n- [Wiki with full walkthrough of the \n  demo](https://github.com/GjjvdBurg/HugoPhotoSwipe/wiki#gallery-configuration)\n- [Blog with introduction to \n  HugoPhotoSwipe](https://gertjanvandenburg.com/blog/hugophotoswipe/)\n\n## Why?\n\nI created my personal website using Hugo, so all source documents are\ncreated as Markdown files. I wanted to have photo albums on the site as\nwell, using the PhotoSwipe viewer. I also wanted to easily set photo\ndescriptions, quickly update albums when photos change, and have\nresponsive image sizes and thumbnails automatically generated.\nHugoPhotoSwipe makes all this easily possible.\n\nSee my blog post\n[here](https://gertjanvandenburg.com/blog/hugophotoswipe/) for more\nabout my motivations for making this tool.\n\n## How?\n\nPhotoSwipe requires some Javascript and a specific HTML format to work,\nand Hugo generally works with Markdown files. So, this program creates a\nmarkdown file for Hugo to work with based on Hugo *shortcodes*. These\nshortcode are then used to create the HTML code that PhotoSwipe needs.\nSee the `docs` directory for the shortcodes.\n\n### Installation\n\nHugoPhotoSwipe is available on PyPI, you can install it easily with pip:\n\n```\n$ pip install hugophotoswipe\n```\n\nAfter installation, you should have an ``hps`` command line program. Try \nrunning ``hps -V`` to check this.\n\n### Usage\n\n*This is a brief overview. See the*\n[Wiki](https://github.com/GjjvdBurg/HugoPhotoSwipe/wiki) *for a full\ndescription.*\n\nCreate a new directory for HugoPhotoSwipe and switch to it. For\ninstance:\n\n```\n$ mkdir hugophotos\n$ cd hugophotos\n```\n\nNext, initialize a HugoPhotoSwipe configuration with:\n\n```\n$ hps init\n```\n\nThis creates a new HugoPhotoSwipe configuration file, called\n`hugophotoswipe.yml`. This is a [YAML\nfile](https://en.wikipedia.org/wiki/YAML). In this configuration file,\nyou need to set at least the `markdown_dir` and `output_dir` variables.\nThese are respectively the directory where the markdown needs to be\nplaced and the directory where the processed photos need to be placed.\nYou may also want to set the `url_prefix` variable, which is added\nbefore the path to the photo files.\n\nCreate a new album using:\n\n```\n$ hps new\n```\n\nHugoPhotoSwipe will ask you for the name of the new album, and create a\ndirectory with that name for you. Try to keep the names short, they are\nnot the final title of the album. Spaces in the name are automatically\nreplaced with underscores. In the new directory you will find an\n`album.yml` file and an empty `photos` directory.\n\nAt this point, you should place some photos in the `photos` directory\nand set the title field of the album in the `album.yml` file. You can\nalso set the album date, the copyright line, and the filename of the\ncoverimage. Key/Value pairs you place under the `properties` line will\nbe placed in the preamble of the markdown file, so you can use them in\nHugo layouts. For instance, you may want to add a country field, camera\ndetails, etc.\n\nIn the main directory (where the `hugophotoswipe.yml` file is), you can\nnow run:\n\n```\n$ hps update\n```\n\nTo create the markdown file, the resized photos, and will update the\n`album.yml` file. HugoPhotoSwipe creates large and small photo sizes, as\nwell as thumbnails using\n[SmartCrop.py](https://github.com/hhatto/smartcrop.py).\n\nIf you now open the `album.yml` file, you'll notice that the fields for\nthe photos and the hashes have been extended. Under `photos:` all the\nphotos in the directory will be listed, with for each photo a `file`,\n`name`, `alt`, and `caption` field. The last three fields can be edited\nby you. Doing this can be useful for SEO of your photos, but is not\nrequired. The `hashes` field in the `album.yml` file is used to detect\nchanges in the photos, and don't need to be edited by you.\n\nFinally, if you want to regenerate all the markdown and resized photos,\nyou can always use:\n\n```\n$ hps clean\n```\n\nto clean everything. This will of course not touch the original photo\nfiles.\n\n# Notes\n\nI've noticed that thumbnails are slightly nicer with\n[SmartCrop.js](https://github.com/jwagner/smartcrop.js) than with\n[SmartCrop.py](https://github.com/hhatto/smartcrop.py). So, in the\n`hugophotoswipe.yml` file, you can set the option `use_smartcrop_js` to\n`True` and the `smartcrop_js_path` to the path of the\n[smartcrop-cli.js](https://github.com/jwagner/smartcrop-cli) utility.\nThis ensures thumbnails are created with SmartCrop.js.\n\nHugoPhotoSwipe is free software, licensed under the GNU General Public\nLicense, version 3 or later (GPLv3). Copyright G.J.J. van den Burg, all\nrights reserved.\n\nIf you find a problem or want to suggest a feature, please let me know by \nopening an issue on GitHub. Don't hesitate, you're helping to make this \nproject better! If you prefer email, you can contact me at ``gertjanvandenburg \nat gmail dot com``.\n\n[![BuyMeACoffee](https://img.shields.io/badge/%E2%98%95-buymeacoffee-ffdd00)](https://www.buymeacoffee.com/GjjvdBurg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGjjvdBurg%2FHugoPhotoSwipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGjjvdBurg%2FHugoPhotoSwipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGjjvdBurg%2FHugoPhotoSwipe/lists"}