A static site script that generates web albums from directories of images and videos. Built with 11ty.
- Open
siteData-example.json
, save assiteData.json
. Edit the properties with your information.theme
can be set tolight
,dark
, orsystem
. - Run
npm install
- For video processing, confirm you have homebrew installed, and use it to install ffmpeg via
brew install ffmpeg
.
- Add folders of images to
src/album-assets/
, where each folder follows theYYYY-MM-DD-Album-Name
format (there are some examples in the repo). - Export your images to these folders as high-resolution JPGs. Images are output in alphabetical order, so
YYYY-MM-DD-HH-MM-SS.jpg
gives you the most reliable sorting by original capture time. Exiftool and a shell script are useful here if your local photo software doesn't give you enough flexibility. - Within an album, you can insert text headings wherever you want. These require a
YYYY-MM-DD-
prefix: a file named2020-05-01-Hiking-in-the-Alps.txt
will render as aHiking in the Alps
heading (and a jump link) just above the images/videos that follow it alphabetically. You can also add secondary text in the contents of the text file. - To hide an album from the sidebar navigation, include
-[hidden]
at the end of your album directory title. - If you've included
.mov
files in your albums, runnpm run video
to process those videos into 720p files. This may take a while. - Run
npm run start
to view your site at http://localhost:3000. Note that the first run with many albums may take a long time to build, since 11ty's image plugin needs to generate 3 optimized files for every original.
- Run
npm run build
to generate the site pages and optimized images. - To build the site files and process videos, run
npm run build-all
. - Your site builds to the
/dist
directory. You can then sFTP the contents to your web server, or use rsync vianpm deploy
. If the latter, store your deploy path in an.npmrc
like this:
deploy_path = username@123.456.78.90:/var/www/photos.example.com/html/
- Display dates to right of text blocks
- Add OG image for album pages
- Light/Dark themes
- Break up album list by year
- JSON feed
- Hidden albums
- Deploy via npm/rsync
- Remove orphaned optimized videos on build
- Method for adding
alt
text to images?