Make additional themes more easily configurable
This commit is contained in:
@@ -10,7 +10,7 @@ module.exports = [
|
||||
const settings = getSettings(req)
|
||||
// console.log(settings)
|
||||
const saved = url.searchParams.has("saved")
|
||||
return render(200, "pug/settings.pug", {saved, settings})
|
||||
return render(200, "pug/settings.pug", {saved, constants, settings})
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -63,10 +63,7 @@ html
|
||||
+checkbox("spa", "Fast navigation", "Enabled", false)
|
||||
|
||||
+fieldset("Appearance")
|
||||
+select("theme", "Theme", false, [
|
||||
{value: "classic", text: "Classic"},
|
||||
{value: "blue", text: "Classic blue"}
|
||||
])
|
||||
+select("theme", "Theme", false, constants.themes.map(entry => ({value: entry.file, text: entry.name})))
|
||||
|
||||
+checkbox("display_top_nav", "Display top bar", "Always", false)
|
||||
|
||||
|
||||
@@ -21,8 +21,9 @@ subdirs("pug", async (err, dirs) => {
|
||||
await require("../lib/utils/upgradedb")()
|
||||
|
||||
pinski.setNotFoundTarget("/404")
|
||||
pinski.addRoute("/static/css/classic.css", "sass/classic.sass", "sass")
|
||||
pinski.addRoute("/static/css/blue.css", "sass/blue.sass", "sass")
|
||||
for (const theme of constants.themes) {
|
||||
pinski.addRoute(`/static/css/${theme.file}.css`, `sass/${theme.file}.sass`, "sass")
|
||||
}
|
||||
pinski.addRoute("/settings", "pug/settings.pug", "pug")
|
||||
pinski.addPugDir("pug", dirs)
|
||||
pinski.addSassDir("sass", ["sass/includes", "sass/themes"])
|
||||
|
||||
Reference in New Issue
Block a user