feat: update default theme to harmony, move default footer widget to sidebar footer

This commit is contained in:
Julian Lam
2022-12-23 14:09:48 -05:00
parent 69a285fa2c
commit 8f5bb18ee5
6 changed files with 10 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
{
"widget": "html",
"data" : {
"html": "<footer id=\"footer\" class=\"container footer\">\r\n\t<div>\r\n\t\tPowered by <a target=\"_blank\" href=\"https://nodebb.org\">NodeBB</a> | <a target=\"_blank\" href=\"//github.com/NodeBB/NodeBB/graphs/contributors\">Contributors</a>\r\n\t</div>\r\n</footer>",
"html": "<footer id=\"footer\" class=\"container footer d-flex flex-column align-items-center gap-1 mb-2\">\n\t<span>Powered by <a class=\"link-secondary text-decoration-underline\" target=\"_blank\" href=\"https://nodebb.org\">NodeBB</a></span>\n\t<span><a class=\"link-secondary\" target=\"_blank\" href=\"//github.com/NodeBB/NodeBB/graphs/contributors\"><i class=\"fa fa-users\"></i> <span class=\"text-decoration-underline\">Contributors<span></a></span>\n</footer>",
"title":"",
"container":""
}

View File

@@ -67,8 +67,8 @@ exports.reset = async function (options) {
' -a\tall of the above',
'',
'Plugin and theme reset flags (-p & -t) can take a single argument',
' e.g. ./nodebb reset -p nodebb-plugin-mentions, ./nodebb reset -t nodebb-theme-persona',
' Prefix is optional, e.g. ./nodebb reset -p markdown, ./nodebb reset -t persona',
' e.g. ./nodebb reset -p nodebb-plugin-mentions, ./nodebb reset -t nodebb-theme-harmony',
' Prefix is optional, e.g. ./nodebb reset -p markdown, ./nodebb reset -t harmony',
].join('\n'));
process.exit(0);
@@ -105,7 +105,7 @@ async function resetTheme(themeId) {
}
async function resetThemes() {
await resetThemeTo('nodebb-theme-persona');
await resetThemeTo('nodebb-theme-harmony');
}
async function resetThemeTo(themeId) {

View File

@@ -250,7 +250,7 @@ async function enableDefaultTheme() {
return;
}
const defaultTheme = nconf.get('defaultTheme') || 'nodebb-theme-persona';
const defaultTheme = nconf.get('defaultTheme') || 'nodebb-theme-harmony';
console.log(`Enabling default theme: ${defaultTheme}`);
await meta.themes.set({
type: 'local',
@@ -530,7 +530,7 @@ async function setCopyrightWidget() {
]);
if (!footer && footerJSON) {
await db.setObjectField('widgets:global', 'footer', footerJSON);
await db.setObjectField('widgets:global', 'sidebar-footer', footerJSON);
}
}

View File

@@ -184,8 +184,8 @@ async function getBundleMetadata(target) {
let themeData = null;
if (target === 'client') {
themeData = await db.getObjectFields('config', ['theme:type', 'theme:id', 'bootswatchSkin']);
const themeId = (themeData['theme:id'] || 'nodebb-theme-persona');
const baseThemePath = path.join(nconf.get('themes_path'), (themeData['theme:type'] && themeData['theme:type'] === 'local' ? themeId : 'nodebb-theme-persona'));
const themeId = (themeData['theme:id'] || 'nodebb-theme-harmony');
const baseThemePath = path.join(nconf.get('themes_path'), (themeData['theme:type'] && themeData['theme:type'] === 'local' ? themeId : 'nodebb-theme-harmony'));
paths.unshift(baseThemePath);
paths.unshift(`${baseThemePath}/node_modules`);

View File

@@ -150,7 +150,7 @@ Themes.setupPaths = async () => {
currentThemeId: Meta.configs.get('theme:id'),
});
const themeId = data.currentThemeId || 'nodebb-theme-persona';
const themeId = data.currentThemeId || 'nodebb-theme-harmony';
if (process.env.NODE_ENV === 'development') {
winston.info(`[themes] Using theme ${themeId}`);

View File

@@ -75,7 +75,7 @@ function loadConfig(configFile) {
// Ensure themes_path is a full filepath
nconf.set('themes_path', path.resolve(paths.baseDir, nconf.get('themes_path')));
nconf.set('core_templates_path', path.join(paths.baseDir, 'src/views'));
nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-persona/templates'));
nconf.set('base_templates_path', path.join(nconf.get('themes_path'), 'nodebb-theme-harmony/templates'));
nconf.set('upload_path', path.resolve(nconf.get('base_dir'), nconf.get('upload_path')));
nconf.set('upload_url', '/assets/uploads');