Added switcher for main content

This commit is contained in:
Nikurasu 2023-01-06 23:21:17 +01:00
parent 18672fcd55
commit 5ad1389583
3 changed files with 14 additions and 2 deletions

View file

@ -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
})
})

View file

@ -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') %>

View file

@ -4,6 +4,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css" integrity="sha256-XoaMnoYC5TH6/+ihMEnospgm0J1PM/nioxbOUdnM8HY=" crossorigin="anonymous">
<link rel="stylesheet" href="style/<%= theme %>.css">
<% if(theme === '98') { %>
<link rel="stylesheet" href="https://unpkg.com/98.css">
<% } %>
<% if(roundPB) { %>
<link rel="stylesheet" href="style/round-pb.css">
<% } %>