mirror of https://github.com/thumbsup/thumbsup
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
var yargs = require('yargs');
|
|
var path = require('path');
|
|
var index = require('../src/index');
|
|
|
|
var opts = yargs
|
|
.usage('Usage: $0 [options]')
|
|
.options({
|
|
'input': {
|
|
description: 'Path to the folder with all photos/videos',
|
|
},
|
|
'output': {
|
|
description: 'Output path for the static website',
|
|
},
|
|
'title': {
|
|
description: 'Website title',
|
|
default: 'My gallery'
|
|
},
|
|
'thumb-size': {
|
|
description: 'Thumbnail size in pixels (square)',
|
|
default: 120
|
|
},
|
|
'large-size': {
|
|
description: 'Fullscreen size in pixels (height)',
|
|
default: 1000
|
|
},
|
|
'css': {
|
|
description: 'Extra CSS file for styling'
|
|
},
|
|
'config': {
|
|
description: 'Optional JSON config file (one key per argument)'
|
|
}
|
|
})
|
|
.config('config')
|
|
.demand(['input', 'output'])
|
|
.argv;
|
|
|
|
index.build({
|
|
input: path.resolve(opts['input']),
|
|
output: path.resolve(opts['output']),
|
|
title: opts['title'],
|
|
thumbSize: opts['thumb-size'],
|
|
largeSize: opts['large-size'],
|
|
css: opts['css']
|
|
});
|