优化代码

i18n
xaoxuu 4 years ago
parent 34e79d28f5
commit 2e7e30bf6d
  1. 2
      layout/_partial/cover.ejs
  2. 3
      layout/_pre.ejs
  3. 24
      layout/layout.ejs

@ -1,4 +1,4 @@
<% if (showCover == true) { %>
<% if (page.cover == true) { %>
<div class="cover-wrapper">
<cover class='cover <%- page.layout %> <%- is_home() ? theme.cover.height : "half" %>'>
<% if (theme.cover.scheme == 'search') { %>

@ -1,4 +1,7 @@
<%
if (page.cover == undefined && theme.cover) {
page.cover = true;
}
if (is_home() || is_category() || is_archive() || is_tag() || page.layout == 'list') {
if (page.sidebar == undefined) {
if (theme.layout.on_list.sidebar.length == 0) {

@ -2,28 +2,8 @@
<html>
<%- partial('_partial/head') %>
<body>
<%
var showCover = false;
if (theme.cover) {
// 如果页面的Front-matter声明了cover,就取页面的值
if (page.cover != undefined && page.cover != undefined) {
showCover = page.cover;
} else {
// 否则,如果是首页,只有首页的第一页显示
if (is_home()) {
if (page.prev) {
showCover = false;
} else {
showCover = true;
}
} else {
showCover = true;
}
}
}
%>
<%- partial('_partial/cover', {showCover: showCover}) %>
<div class="l_body<%- showCover ? '' : ' nocover' %>">
<%- partial('_partial/cover') %>
<div class="l_body<%- page.cover ? '' : ' nocover' %>">
<div class='body-wrapper'>
<%- body %>
<script>setLoadingBarProgress(60);</script>

Loading…
Cancel
Save