I got fed up with how laborious it was to post new photos to my website. I had to write things and I'm lazy. I've removed all the fluff and made the whole process of adding new photos easier—I've essentially made a Node built static site version of tumblr…
samking.co is a "static site" that gets generated purely by images and their associated meta data. I'll outline the build process below:
lib/get-image-list.jsreads all the image files inside
- It picks certain bits of meta data for each image, along with resizing the image into different formats to
- It generates a JSON object as a way of caching what images have already been processed as it's quite computationally expensive.
lib/get-site-data.jsgets passed the data from
lib/get-image-data.jsand generates new data for different pages e.g. groups of images by keyword to create a tags directory.
- It too saves it's output as a JSON file as a way of caching.
build.jsgets this big site list and goes off to render the correct templates at the right urls.
- Once the pages are rendered, then it's just a case of building and copying all static files to the final
Design the thing Build the front-end Make it mobile Simplify some of the build steps Set up some kind of deployment script
- Build static files in a better way so I can keep mtimes
- Set up a better gzip process for S3
- Write all the docs