2016-11-04 00:31:35 +00:00
|
|
|
# thumbsup
|
2014-04-17 11:26:18 +00:00
|
|
|
|
2014-08-05 03:24:14 +00:00
|
|
|
[![NPM](http://img.shields.io/npm/v/thumbsup.svg?style=flat)](https://npmjs.org/package/thumbsup)
|
2016-11-04 00:31:35 +00:00
|
|
|
[![License](http://img.shields.io/npm/l/thumbsup.svg?style=flat)](https://github.com/thumbsup/node-thumbsup)
|
2017-02-05 08:55:43 +00:00
|
|
|
[![Travis CI](https://travis-ci.org/thumbsup/node-thumbsup.svg?branch=master)](https://travis-ci.org/thumbsup/node-thumbsup)
|
2016-11-04 00:31:35 +00:00
|
|
|
[![Dependencies](http://img.shields.io/david/thumbsup/node-thumbsup.svg?style=flat)](https://david-dm.org/thumbsup/node-thumbsup)
|
2016-11-12 04:30:14 +00:00
|
|
|
[![Dev dependencies](https://david-dm.org/thumbsup/node-thumbsup/dev-status.svg?style=flat)](https://david-dm.org/thumbsup/node-thumbsup?type=dev)
|
2016-11-04 00:31:35 +00:00
|
|
|
|
|
|
|
![banner](banner.jpg)
|
2014-08-05 03:24:14 +00:00
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
Turn any folder with photos & videos into a web gallery.
|
2014-04-17 11:26:18 +00:00
|
|
|
|
2014-06-10 02:53:06 +00:00
|
|
|
- thumbnails & multiple resolutions for fast previews
|
2016-10-16 06:09:42 +00:00
|
|
|
- mobile friendly website with customisable themes
|
2014-04-21 09:39:48 +00:00
|
|
|
- only rebuilds changed files: it's fast!
|
2014-04-17 11:26:18 +00:00
|
|
|
- uses relative paths so you can deploy the pages anywhere
|
|
|
|
- works great with Amazon S3 for static hosting
|
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
## Quick start
|
2014-04-17 11:26:18 +00:00
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
Simply point `thumbsup` to a folder with photos & videos. All nested folders become separate albums.
|
2016-09-27 08:37:07 +00:00
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
*Requirements*
|
2016-09-27 08:37:07 +00:00
|
|
|
- [Node.js](http://nodejs.org/): `brew install Node`
|
2017-02-27 13:13:45 +00:00
|
|
|
- [exiftool](http://www.sno.phy.queensu.ca/~phil/exiftool/): `brew install exiftool`
|
2016-09-27 08:37:07 +00:00
|
|
|
- [GraphicsMagick](http://www.graphicsmagick.org/): `brew install graphicsmagick`
|
|
|
|
- [FFmpeg](http://www.ffmpeg.org/): `brew install ffmpeg`
|
|
|
|
|
2016-10-13 12:13:04 +00:00
|
|
|
|
2016-09-27 08:37:07 +00:00
|
|
|
```bash
|
2017-03-01 10:57:55 +00:00
|
|
|
npm install -g thumbsup
|
2016-11-04 00:31:35 +00:00
|
|
|
thumbsup --input ./media --output ./website
|
2014-04-17 11:26:18 +00:00
|
|
|
```
|
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
There are many more command line arguments to customise the output.
|
|
|
|
You can also run `thumbsup` as a Docker container which pre-packages all dependencies like `ffmpeg`.
|
|
|
|
See the website for the full documentation: https://thumbsup.github.io.
|
2016-10-16 06:09:42 +00:00
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
## Sample gallery
|
2016-10-13 12:13:04 +00:00
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
See a sample gallery online at https://thumbsup.github.io/demos/themes/mosaic/
|
2016-09-27 08:37:07 +00:00
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
![sample gallery](screenshot.png)
|
2014-04-17 11:26:18 +00:00
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
## Command line arguments
|
2014-04-17 11:26:18 +00:00
|
|
|
|
2016-11-11 20:38:27 +00:00
|
|
|
This reflects the CLI for the latest code on `master`.
|
2016-11-04 00:31:35 +00:00
|
|
|
For the latest published version please refer to the [docs on the website](https://thumbsup.github.io).
|
2014-04-21 09:39:48 +00:00
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
<!-- START cli -->
|
2014-04-21 09:39:48 +00:00
|
|
|
```
|
2016-10-13 12:13:04 +00:00
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
Usages:
|
|
|
|
thumbsup [required] [options]
|
|
|
|
thumbsup --config config.json
|
|
|
|
|
|
|
|
Required:
|
|
|
|
--input Path to the folder with all photos/videos [string] [required]
|
|
|
|
--output Output path for the static website [string] [required]
|
|
|
|
|
|
|
|
Options:
|
|
|
|
--help Show help [boolean]
|
2017-02-07 12:19:22 +00:00
|
|
|
--index Filename of the home page [default: "index.html"]
|
2016-11-04 00:31:35 +00:00
|
|
|
--title Website title [default: "Photo album"]
|
2017-02-07 12:19:22 +00:00
|
|
|
--footer Text or HTML footer [default: null]
|
2016-11-04 00:31:35 +00:00
|
|
|
--thumb-size Pixel size of the square thumbnails [number] [default: 120]
|
|
|
|
--large-size Pixel height of the fullscreen photos [number] [default: 1000]
|
|
|
|
--original-photos Allow download of full-size photos [boolean] [default: false]
|
|
|
|
--original-videos Allow download of full-size videos [boolean] [default: false]
|
2017-02-07 12:19:22 +00:00
|
|
|
--albums-output-folder Output subfolder for HTML albums (default: root of gallery) [default: "."]
|
2016-11-04 00:31:35 +00:00
|
|
|
--albums-from How to group media into albums [choices: "folders", "date"] [default: "folders"]
|
|
|
|
--albums-date-format How albums are named in <date> mode [moment.js pattern] [default: "YYYY-MM"]
|
|
|
|
--sort-folders How to sort albums [deprecated] [choices: "name", "date"]
|
2017-02-05 07:36:03 +00:00
|
|
|
--sort-albums-by How to sort albums [choices: "title", "start-date", "end-date"] [default: "start-date"]
|
2016-11-04 00:31:35 +00:00
|
|
|
--sort-albums-direction Album sorting direction [choices: "asc", "desc"] [default: "asc"]
|
|
|
|
--sort-media-by How to sort photos and videos [choices: "filename", "date"] [default: "date"]
|
|
|
|
--sort-media-direction Media sorting direction [choices: "asc", "desc"] [default: "asc"]
|
|
|
|
--theme Name of the gallery theme to apply [choices: "classic", "cards", "mosaic"] [default: "classic"]
|
|
|
|
--css Path to a CSS/LESS file for styling [string]
|
|
|
|
--google-analytics Code for Google Analytics tracking [string]
|
2017-02-07 12:19:22 +00:00
|
|
|
--config Path to JSON config file [string]
|
2016-11-04 00:31:35 +00:00
|
|
|
|
2016-11-11 20:38:27 +00:00
|
|
|
The optional JSON config should contain a single object with one key per argument, not including the leading "--". For example:
|
2016-11-04 00:31:35 +00:00
|
|
|
|
|
|
|
{ "sort-albums-by": "start-date" }
|
2016-10-13 12:13:04 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
<!-- END cli -->
|
2014-04-17 11:26:18 +00:00
|
|
|
|
2016-11-04 00:31:35 +00:00
|
|
|
## Contributing
|
2014-04-17 11:26:18 +00:00
|
|
|
|
2016-11-12 04:27:16 +00:00
|
|
|
We welcome all [issues](https://github.com/thumbsup/node-thumbsup/issues)
|
|
|
|
and [pull requests](https://github.com/thumbsup/node-thumbsup/pulls)!
|
2017-02-28 07:07:25 +00:00
|
|
|
|
|
|
|
If you are facing any issues or getting crashes, you can run `thumbsup` in debug mode
|
|
|
|
to get a verbose troubleshooting log of all operations:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
DEBUG="*" thumbsup [options]
|
|
|
|
```
|
|
|
|
|
2016-11-12 04:27:16 +00:00
|
|
|
Please make sure the tests are passing when submitting a code change:
|
|
|
|
|
2016-09-27 08:37:07 +00:00
|
|
|
```bash
|
2016-11-12 04:27:16 +00:00
|
|
|
./scripts/cibuild
|
2014-05-19 12:26:08 +00:00
|
|
|
```
|