Set Skin via CLI
-
Hello everyone,
I am developing a custom skin for Bootstrap and would like to have it automatically applied to my forum when deploying NodeBB to a server, i.e. it should not be necessary to visit the ACP. However, I have not found a way to either provide such a custom skin via the CLI or to set a skin. Is this feature supported?
If it is not supported, I would like to know the recommended way to automatically apply Bootstrap theming to NodeBB. One way would be to make the Bootstrap theme part of the NodeBB theme, but ideally I'd like to separate the bootstrap theme from the NodeBB templates in the codebase.
Thank you very much for your help!
-
Changing skins is not supported by any CLI commands right now. Only themes can be changed. Maybe you could create a javascript file in the nodebb folder and run that during deploy to change the skin. The below should work.
/* globals require, console, process */ 'use strict'; const nconf = require('nconf'); nconf.file({ file: 'config.json', }); nconf.defaults({ base_dir: __dirname, views_dir: './build/public/templates', upload_path: 'public/uploads', }); const db = require('./src/database'); db.init(async (err) => { if (err) { console.log(`NodeBB could not connect to your database. Error: ${err.message}`); process.exit(); } await db.setObjectField('config', 'bootswatchSkin', 'nameofyourskin'); process.exit(); });
-
-
@lase You might be interested in this.
Swatch / Theme Changer
Hi all, As most of you know, there is a swatch / theme switcher on this site, which can be found here I decided to create this based on an idea from @DownPW...
Sudonix | A one-stop-shop for all your technology questions (sudonix.org)