add headerbar and logo options as command line arguments

This commit is contained in:
tobias 2021-12-01 11:28:56 +00:00 committed by Florian
parent 2a292ade9b
commit 601d7968db
2 changed files with 15 additions and 8 deletions

View file

@ -69,8 +69,7 @@ Some customisation options
Header Bar
==========
In `config.js` set `headerBarUrl` to a json url containing :
Set the argument `--headerBarUrl` with an URL pointing to a JSON with the following structure :
```json
[
@ -82,7 +81,7 @@ In `config.js` set `headerBarUrl` to a json url containing :
Logo
====
In `config.js` set `logoUrl` to an image url
Set the argument `--logoUrl` with an URL pointing to your logo.
license
-------

View file

@ -7,7 +7,16 @@
*/
var argv = require("yargs").usage(
'Usage: $0 [--port INTEGER [8080]] [--baseurl STRING ["/"]] [--redis STRING:INT [127.0.0.1:6379]] [--gaEnabled] [--gaAccount STRING [UA-2069672-4]]'
'Usage: $0 [--port INTEGER [8080]] \
[--baseurl STRING ["/"]] \
[--redis STRING:INT [127.0.0.1:6379]] \
[--gaEnabled] \
[--gaAccount STRING [UA-2069672-4]] \
[--headerBarUrl STRING] \
[--logoUrl STRING] \
[--faviconUrl STRING] \ '
).argv
exports.server = {
@ -29,7 +38,6 @@ exports.database = {
port: redis_conf.split(":")[1] || 6379,
}
exports.headerBarUrl =
null /* example url with appropriate json markup : 'https://colibris-lemouvement.org/archipel-markup?domain=colibris-outilslibres.org' */
exports.logoUrl = null /* example logo url : 'https://postit.colibris-outilslibres.org/images/logo-Post-it.svg' */
exports.faviconUrl = null /* example favicon url : 'https://postit.colibris-outilslibres.org/images/favicon.png' */
exports.headerBarUrl = argv['headerBarUrl'] || null /* example url with appropriate json markup : 'https://colibris-lemouvement.org/archipel-markup?domain=colibris-outilslibres.org' */
exports.logoUrl = argv['logoUrl'] || null /* example logo url : 'https://postit.colibris-outilslibres.org/images/logo-Post-it.svg' */
exports.faviconUrl = argv['faviconUrl'] || null /* example favicon url : 'https://postit.colibris-outilslibres.org/images/favicon.png' */