Giter Club home page Giter Club logo

photobox's Introduction

Photobox

A static site script that generates web albums from directories of images and videos. Built with 11ty.

Screenshot of home view Screenshot of album view

Local setup

  1. Open siteData-example.json, save as siteData.json. Edit the properties with your information. theme can be set to light, dark, or system.
  2. Run npm install
  3. For video processing, confirm you have homebrew installed, and use it to install ffmpeg via brew install ffmpeg.

Creating albums

  1. Add folders of images to src/album-assets/, where each folder follows the YYYY-MM-DD-Album-Name format (there are some examples in the repo).
  2. 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.
  3. Within an album, you can insert text headings wherever you want. These require a YYYY-MM-DD- prefix: a file named 2020-05-01-Hiking-in-the-Alps.txt will render as a Hiking 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.
  4. To hide an album from the sidebar navigation, include -[hidden] at the end of your album directory title.
  5. If you've included .mov files in your albums, run npm run video to process those videos into 720p files. This may take a while.
  6. 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.

Building and Deploying

  1. Run npm run build to generate the site pages and optimized images.
  2. To build the site files and process videos, run npm run build-all.
  3. Your site builds to the /dist directory. You can then sFTP the contents to your web server, or use rsync via npm deploy. If the latter, store your deploy path in an .npmrc like this:
deploy_path = [email protected]:/var/www/photos.example.com/html/

Development roadmap

Done

  • 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

Up Next?

  • Remove orphaned optimized videos on build
  • Method for adding alt text to images?

photobox's People

Contributors

jmuspratt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.