2
0
mirror of https://github.com/thumbsup/thumbsup synced 2024-11-03 15:40:14 +00:00
Go to file
Romain d6432f92b8 Merge pull request #38 from navneetkarnani/master
Add support for custom start file
2016-09-19 13:04:40 +10:00
_site@deae802cdc Bumped up gh-pages 2015-09-22 21:43:16 +10:00
bin Add support for custom start file 2016-09-18 23:59:17 +05:30
example/media Read EXIF captions, and display at the bottom of the slideshow. 2015-09-22 21:41:32 +10:00
public Read EXIF captions, and display at the bottom of the slideshow. 2015-09-22 21:41:32 +10:00
src Add support for custom start file 2016-09-18 23:59:17 +05:30
templates Upgrade to LightGallery 1.2.2, and use VideoJS for playing videos 2015-09-22 19:46:52 +10:00
.gitignore Initial commit 2014-04-17 21:26:18 +10:00
.gitmodules added gh-pages as submodule 2014-06-10 12:30:17 +10:00
.npmignore More files for npmignore 2014-09-14 23:32:19 +10:00
example.json Fix #18: don't upload original media by default, add new command line options 2014-11-29 18:30:57 +11:00
LICENSE.md Update license to MIT 2014-05-19 22:25:09 +10:00
package.json 1.1.2 2016-01-27 08:03:25 +11:00
README.md README: note about the issue with Ubuntu 10.04 2015-10-14 12:23:09 +11:00
screenshot.jpg Update README screenshot 2014-12-02 00:11:42 +11:00

thumbsup

NPM License Dependencies

Build static HTML galleries from local photos & videos.

  • thumbnails & multiple resolutions for fast previews
  • only rebuilds changed files: it's fast!
  • supports custom styles
  • uses relative paths so you can deploy the pages anywhere
  • works great with Amazon S3 for static hosting

View sample website

screenshot

Requirements

Note: there currently is an issue with Ubuntu 14.04 if you build ffmpeg from source. Please upgrade to 14.10 and install it with apt-get.

Input

Any folder with photos and videos. thumbsup currently supports 1 level of subfolders, where they each become a gallery.

input
  |
  |__ paris
  |    |__ img001.jpg
  |    |__ img002.jpg
  |
  |__ sydney
       |__ vid001.mp4
       |__ img003.png

Generating the galleries

Install the module globally, which puts the binary in your path:

$ npm install -g thumbsup
$ thumbsup [args]

  List all files      [===================] 6/6 files
  Update metadata     [===================] 6/6 files
  Original photos     [===================] 6/6 files
  Original videos     [===================] 6/6 files
  Photos (large)      [===================] 5/5 files
  Photos (thumbs)     [===================] 5/5 files
  Videos (resized)    [===================] 1/1 files
  Videos (poster)     [===================] 1/1 files
  Videos (thumbs)     [===================] 1/1 files
  Static website      [===================] done

  Gallery generated successfully

The following args are required:

  • --input <path> path to the folder with photos / videos
  • --output <path> target output folder

And you can optionally specify:

  • --title [text] website title (default: Photo gallery)
  • --thumb-size [pixels] thumbnail image size (default: 120)
  • --large-size [pixels] fullscreen image size (default: 1000)
  • --original-photos [true|false] to allow download of full-size photos (default: false)
  • --original-videos [true|false] to allow download of full-size videos (default: false)
  • --sort-folders [name|date] how to sort the folders/galleries (default: date)
  • --css [file] styles to be applied on top of the default theme (no default)
  • --google-analytics [code] code for Google Analytics tracking (no default)

Note: all paths are relative to the current working directory. For example:

thumbsup --input "/media/photos" --output "./website" --title "My holidays" --thumb-size 200 --large-size 1500 --full-size-photos true --sort-folders date --css "./custom.css" --google-analytics "UA-999999-9"

You can also save all your arguments to a JSON file:

thumbsup --config config.json

config.json

{
  "input": "/media/output",
  "output": "./website",
  "title": "My holiday",
  "thumb-size": 200,
  "large-size": 1500,
  "original-photos": true,
  "original-videos": false,
  "sort-folders": "date",
  "css": "./custom.css",
  "google-analytics": "UA-999999-9"
}

Website structure

The generated static website has the following structure:

website
  |__ index.html
  |__ sydney.html
  |__ paris.html
  |__ public
  |__ media
  |    |__ original
  |    |__ large
  |    |__ thumbs

Deployment

The simplest is to deploy the media and generated pages to S3 buckets on AWS using the AWS CLI tools.

  • aws s3 sync ./generated/website s3://my.website.bucket --delete

You can also use s3cmd which offer a few more options.

  • s3cmd sync --config=<credentials> --delete-removed --exclude-from <exclude-file> ./generated/website/ s3://my.website.bucket/

Password protection

Amazon S3 buckets do not offer any type of authentication. However you can choose to deploy to another web server that offers password protection, such as HTTP Basic Auth.

An alternative is to deploy the galleries to UUID-based locations, like Dropbox shared galleries.

Dev notes

To create the sample gallery locally:

npm run clean      # clean the output
npm run example    # build the gallery
npm run open       # open it in the browser