From 5ad13895835c82adb7847d652f45405260fcc73d Mon Sep 17 00:00:00 2001 From: Nikurasu Date: Fri, 6 Jan 2023 23:21:17 +0100 Subject: [PATCH] Added switcher for main content --- src/index.js | 7 ++++++- src/views/index.ejs | 6 +++++- src/views/partials/head.ejs | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index efefc29..a89dbef 100644 --- a/src/index.js +++ b/src/index.js @@ -10,6 +10,10 @@ const app = express() const port = process.env.PORT || 3000 const engine = 'ejs' +const customMainTagThemes = [ + '89' +] + app.set('view engine', engine) app.set('views', './src/views') app.use(express.static('src/dist')) @@ -24,7 +28,8 @@ app.get('/', (req, res) => { links: config.links, smallLinks: config.smallLinks, theme: config.theme, - roundPB: config.roundPB + roundPB: config.roundPB, + customMainTagThemes }) }) diff --git a/src/views/index.ejs b/src/views/index.ejs index b036943..ec3dca3 100644 --- a/src/views/index.ejs +++ b/src/views/index.ejs @@ -1,4 +1,8 @@ <%- include('partials/head') %> <%- include('partials/header') %> -<%- include('partials/defaultMain') %> +<% if(customMainTagThemes.includes(theme)) { %> + <%- include(`partials/${theme}_main`) %> +<% } else { %> + <%- include('partials/defaultMain') %> +<% } %> <%- include('partials/footer') %> diff --git a/src/views/partials/head.ejs b/src/views/partials/head.ejs index c67396a..bebef90 100644 --- a/src/views/partials/head.ejs +++ b/src/views/partials/head.ejs @@ -4,6 +4,9 @@ + <% if(theme === '98') { %> + + <% } %> <% if(roundPB) { %> <% } %>