From 601d7968db4242530d0c348af6b110cc76b658da Mon Sep 17 00:00:00 2001 From: tobias Date: Wed, 1 Dec 2021 11:28:56 +0000 Subject: [PATCH] add headerbar and logo options as command line arguments --- README.md | 5 ++--- config.js | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 564a0b2..f39ff9a 100644 --- a/README.md +++ b/README.md @@ -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 ------- diff --git a/config.js b/config.js index ed53851..345721e 100644 --- a/config.js +++ b/config.js @@ -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' */