Merge pull request #168 from witzig/custom-scripts-and-styles
Inject custom CSS and JS files in layout.hbs
This commit is contained in:
commit
f6f5f4e831
3 changed files with 17 additions and 0 deletions
3
app.js
3
app.js
|
@ -180,6 +180,9 @@ app.use((req, res, next) => {
|
||||||
res.locals.menu = menu;
|
res.locals.menu = menu;
|
||||||
tools.updateMenu(res);
|
tools.updateMenu(res);
|
||||||
|
|
||||||
|
res.locals.customStyles = config.customstyles || [];
|
||||||
|
res.locals.customScripts = config.customscripts || [];
|
||||||
|
|
||||||
settingsModel.list(['ua_code', 'shoutout'], (err, configItems) => {
|
settingsModel.list(['ua_code', 'shoutout'], (err, configItems) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
|
|
|
@ -30,6 +30,12 @@ editors=[
|
||||||
# Default language to use
|
# Default language to use
|
||||||
language="en"
|
language="en"
|
||||||
|
|
||||||
|
# Inject custom styles in layout.hbs
|
||||||
|
# customstyles=["/custom/hello-world.css"]
|
||||||
|
|
||||||
|
# Inject custom scripts in layout.hbs
|
||||||
|
# customscripts=["/custom/hello-world.js"]
|
||||||
|
|
||||||
# If you start out as a root user (eg. if you want to use ports lower than 1000)
|
# If you start out as a root user (eg. if you want to use ports lower than 1000)
|
||||||
# then you can downgrade the user once all services are up and running
|
# then you can downgrade the user once all services are up and running
|
||||||
#user="nobody"
|
#user="nobody"
|
||||||
|
|
|
@ -25,6 +25,14 @@
|
||||||
<link rel="stylesheet" href="/summernote/summernote.css">
|
<link rel="stylesheet" href="/summernote/summernote.css">
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{#each customStyles}}
|
||||||
|
<link rel="stylesheet" href="{{this}}">
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
{{#each customScripts}}
|
||||||
|
<script src="{{this}}"></script>
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue