2024-01-17 14:07:30 +08:00
|
|
|
<%
|
2024-01-18 22:11:58 +08:00
|
|
|
// 页面类型:索引页面还是内容页面
|
2024-01-17 14:07:30 +08:00
|
|
|
var page_type = 'index'
|
2024-01-18 22:11:58 +08:00
|
|
|
if (['post', 'page', 'wiki', null].includes(page.layout)) {
|
2024-01-17 14:07:30 +08:00
|
|
|
if (!page.nav_tabs) {
|
|
|
|
page_type = 'content'
|
|
|
|
}
|
|
|
|
}
|
2024-01-18 22:11:58 +08:00
|
|
|
// 文章类型:技术类文章/文学类文章
|
|
|
|
var article_type = theme.article.type
|
|
|
|
if (page.type?.length > 0) {
|
|
|
|
article_type = page.type
|
|
|
|
}
|
|
|
|
// 是否缩进
|
|
|
|
var indent = false
|
|
|
|
if (page.indent != null) {
|
|
|
|
indent = page.indent
|
|
|
|
} else if (page.topic && theme.topic.tree[page.topic] && (theme.topic.tree[page.topic].indent != null)) {
|
|
|
|
indent = theme.topic.tree[page.topic].indent
|
|
|
|
} else if (page.wiki && theme.wiki.tree[page.wiki] && (theme.wiki.tree[page.wiki].indent != null)) {
|
|
|
|
indent = theme.wiki.tree[page.wiki].indent
|
|
|
|
} else if (theme.article.indent) {
|
|
|
|
indent = theme.article.indent
|
|
|
|
} else {
|
|
|
|
indent = article_type === 'story'
|
|
|
|
}
|
2024-01-17 14:07:30 +08:00
|
|
|
|
|
|
|
var html = `<!DOCTYPE html>`
|
|
|
|
html += `<html lang="${page.lang}">`
|
|
|
|
html += partial('_partial/head')
|
|
|
|
html += `<body>`
|
|
|
|
html += partial('_partial/cover/index')
|
2024-01-18 22:11:58 +08:00
|
|
|
html += `<div class="l_body ${page_type} ${article_type}" id="start" layout="${page.layout}" ${indent ? 'text-indent' : ''}>`
|
2024-01-17 14:07:30 +08:00
|
|
|
html += `<aside class="l_left">`
|
2024-01-18 22:11:58 +08:00
|
|
|
// html += `<img no-lazy class="sidebar-bg" src="${theme.style.sidebar.background}">`
|
|
|
|
html += `<div class="sidebar-container${theme.style.sidebar?.blur ? ' sidebar-blur' : ''}">`
|
2024-01-17 14:07:30 +08:00
|
|
|
html += partial('_partial/sidebar/index')
|
|
|
|
html += `</div>`
|
|
|
|
html += `</aside>`
|
|
|
|
html += `<div class="l_main" id="main">`
|
|
|
|
html += partial('_partial/sidebar/logo', {where: 'main'})
|
|
|
|
html += body
|
|
|
|
html += partial('_partial/main/footer')
|
|
|
|
html += partial('_partial/menubtn')
|
|
|
|
html += `<div class="main-mask" onclick="sidebar.toggle()"></div>`
|
|
|
|
html += `</div>`
|
|
|
|
html += `</div>`
|
|
|
|
html += `<div class="scripts">`
|
|
|
|
html += partial('_partial/scripts/index')
|
|
|
|
html += `</div>`
|
|
|
|
html += `</body>`
|
|
|
|
html += `</html>`
|
|
|
|
%>
|
|
|
|
<%- html %>
|