Add useCDN option
This commit is contained in:
parent
062911f277
commit
0a42e69fc2
7 changed files with 24 additions and 7 deletions
|
@ -1,4 +1,7 @@
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
|
||||||
|
const yesNo = require('yes-no');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
dbUrl: process.env.DB_URL || 'db',
|
dbUrl: process.env.DB_URL || 'db',
|
||||||
defaultFailureRedirect: process.env.DEFAULT_FAILURE_REDIRECT || '/login',
|
defaultFailureRedirect: process.env.DEFAULT_FAILURE_REDIRECT || '/login',
|
||||||
|
@ -6,5 +9,6 @@ module.exports = {
|
||||||
proxyServer: process.env.PROXY_SERVER || undefined,
|
proxyServer: process.env.PROXY_SERVER || undefined,
|
||||||
secret: process.env.SECRET || require('./secret'),
|
secret: process.env.SECRET || require('./secret'),
|
||||||
sessionMaxAge: Number(process.env.SESSION_MAX_AGE) || 1000 * 60 * 60 * 24 * 7,
|
sessionMaxAge: Number(process.env.SESSION_MAX_AGE) || 1000 * 60 * 60 * 24 * 7,
|
||||||
siteTitle: process.env.SITE_TITLE || 'Christmas Community'
|
siteTitle: process.env.SITE_TITLE || 'Christmas Community',
|
||||||
|
useCDN: yesNo.parse(process.env.USE_CDN || true)
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
"passport-local": "^1.0.0",
|
"passport-local": "^1.0.0",
|
||||||
"pouchdb": "^7.0.0",
|
"pouchdb": "^7.0.0",
|
||||||
"pug": "^2.0.3",
|
"pug": "^2.0.3",
|
||||||
"uuid": "^3.3.2"
|
"uuid": "^3.3.2",
|
||||||
|
"yes-no": "^0.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
@import "https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.0/css/bulma.min.css";
|
|
||||||
|
|
||||||
.inline {
|
.inline {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
1
static/libraries/css/bulma.min.css
vendored
Normal file
1
static/libraries/css/bulma.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
5
static/libraries/css/fontawesome.css
vendored
Normal file
5
static/libraries/css/fontawesome.css
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -6,15 +6,18 @@ html(lang='en')
|
||||||
title #{config.siteTitle} - #{title}
|
title #{config.siteTitle} - #{title}
|
||||||
else
|
else
|
||||||
title #{config.siteTitle}
|
title #{config.siteTitle}
|
||||||
link(rel='stylesheet', href='/css/main.css')
|
if config.useCDN
|
||||||
noscript
|
link(rel='stylesheet', href='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.min.css')
|
||||||
link(
|
link(
|
||||||
rel='stylesheet',
|
rel='stylesheet',
|
||||||
href='https://use.fontawesome.com/releases/v5.0.10/css/all.css',
|
href='https://use.fontawesome.com/releases/v5.0.10/css/all.css',
|
||||||
integrity='sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg',
|
integrity='sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg',
|
||||||
crossorigin='anonymous'
|
crossorigin='anonymous'
|
||||||
)
|
)
|
||||||
script(defer, src='https://use.fontawesome.com/releases/v5.0.7/js/all.js')
|
else
|
||||||
|
link(rel='stylesheet', href='/libraries/css/bulma.min.css')
|
||||||
|
link(rel='stylesheet', href='/libraries/css/fontawesome.css')
|
||||||
|
link(rel='stylesheet', href='/css/main.css')
|
||||||
body
|
body
|
||||||
include includes/navbar.pug
|
include includes/navbar.pug
|
||||||
div.content#pageContent
|
div.content#pageContent
|
||||||
|
|
|
@ -1853,3 +1853,8 @@ yauzl@2.4.1:
|
||||||
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005"
|
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005"
|
||||||
dependencies:
|
dependencies:
|
||||||
fd-slicer "~1.0.1"
|
fd-slicer "~1.0.1"
|
||||||
|
|
||||||
|
yes-no@^0.0.1:
|
||||||
|
version "0.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/yes-no/-/yes-no-0.0.1.tgz#c859d9bbc6557d99c4d8676b61a99280ceed6ee1"
|
||||||
|
integrity sha1-yFnZu8ZVfZnE2GdrYamSgM7tbuE=
|
||||||
|
|
Loading…
Reference in a new issue