i18n
xaoxuu 5 years ago
parent e65721bdaf
commit 3ae64da7d3
  1. 1
      layout/_cover/search.ejs
  2. 6
      layout/_meta/title.ejs
  3. 2
      layout/_partial/cover.ejs
  4. 4
      layout/_partial/header.ejs
  5. 7
      source/js/app.js
  6. 4
      source/less/_base.less

@ -3,7 +3,6 @@
<% } else { %> <% } else { %>
<h1 class='title'><%- theme.cover.title ? theme.cover.title : config.title %></h1> <h1 class='title'><%- theme.cover.title ? theme.cover.title : config.title %></h1>
<% } %> <% } %>
<br>
<% if (theme.search.enable === true) { %> <% if (theme.search.enable === true) { %>
<div class="m_search"> <div class="m_search">
<form name="searchform" class="form u-search-form"> <form name="searchform" class="form u-search-form">

@ -6,6 +6,10 @@
</h2> </h2>
<% } else { %> <% } else { %>
<% if (post.title || page.title || config.title) { %> <% if (post.title || page.title || config.title) { %>
<h1 class="title"><%- post.title ? post.title : date(post.date, theme.date_format) %></h1> <h1 class="title">
<a href="<%- url_for(post.path) %>">
<%- post.title ? post.title : date(post.date, theme.date_format) %>
</a>
</h1>
<% } %> <% } %>
<% } %> <% } %>

@ -21,7 +21,7 @@ if (theme.cover) {
<% if (showCover == true) { %> <% if (showCover == true) { %>
<div class="cover-wrapper"> <div class="cover-wrapper">
<div class='cover <%- is_home() ? theme.cover.height : "half" %>'> <div class='cover <%- page.layout %> <%- is_home() ? theme.cover.height : "half" %>'>
<% if (theme.cover.scheme == 'search') { %> <% if (theme.cover.scheme == 'search') { %>
<%- partial('../_cover/search') %> <%- partial('../_cover/search') %>
<% } %> <% } %>

@ -53,7 +53,9 @@
<a class="logo flat-box"></a> <a class="logo flat-box"></a>
<ul class='switcher h-list'> <ul class='switcher h-list'>
<li class='s-comment'><a class="flat-btn fas fa-comments fa-fw" href='javascript:void(0)'></a></li> <li class='s-comment'><a class="flat-btn fas fa-comments fa-fw" href='javascript:void(0)'></a></li>
<li class='s-toc'><a class="flat-btn fas fa-list fa-fw" href='javascript:void(0)'></a></li> <% if (page.sidebar == undefined || page.sidebar != false) { %>
<li class='s-toc'><a class="flat-btn fas fa-list fa-fw" href='javascript:void(0)'></a></li>
<% } %>
</ul> </ul>
</div> </div>
</div> </div>

@ -8,7 +8,7 @@ var customSearch;
if ($headerAnchor[0]) { if ($headerAnchor[0]) {
scrollCorrection = $headerAnchor[0].clientHeight + 16; scrollCorrection = $headerAnchor[0].clientHeight + 16;
} }
function scrolltoElement(elem, correction) { function scrolltoElement(elem, correction) {
correction = correction || scrollCorrection; correction = correction || scrollCorrection;
const $elem = elem.href ? $(elem.getAttribute('href')) : $(elem); const $elem = elem.href ? $(elem.getAttribute('href')) : $(elem);
@ -19,12 +19,17 @@ var customSearch;
// button // button
const $postsBtn = $('.menu .active'); const $postsBtn = $('.menu .active');
const $topBtn = $('.s-top'); const $topBtn = $('.s-top');
const $titleBtn = $('h1.title', '#header-meta');
console.log($titleBtn);
// anchor // anchor
const $bodyAnchor = $('.l_body'); const $bodyAnchor = $('.l_body');
// action // action
if ($postsBtn.length && $bodyAnchor) { if ($postsBtn.length && $bodyAnchor) {
$postsBtn.click(e => { e.preventDefault(); e.stopPropagation(); scrolltoElement($bodyAnchor); }); $postsBtn.click(e => { e.preventDefault(); e.stopPropagation(); scrolltoElement($bodyAnchor); });
} }
if ($titleBtn.length && $bodyAnchor) {
$titleBtn.click(e => { e.preventDefault(); e.stopPropagation(); scrolltoElement($bodyAnchor); });
}
if ($topBtn.length && $bodyAnchor) { if ($topBtn.length && $bodyAnchor) {
$topBtn.click(e => { e.preventDefault(); e.stopPropagation(); scrolltoElement($bodyAnchor); }); $topBtn.click(e => { e.preventDefault(); e.stopPropagation(); scrolltoElement($bodyAnchor); });
} }

@ -81,7 +81,7 @@ fancybox{
.m_search{ .m_search{
@iconW: 32px; @iconW: 32px;
@iconMargin: 4px; @iconMargin: 4px;
margin-top: 2vh; margin-top: ~"calc(2vh + 2*@{gap})";
position: relative; position: relative;
max-width: ~"calc(100% - 1*@{gap})"; max-width: ~"calc(100% - 1*@{gap})";
width: 1.1*@width_sidebar; width: 1.1*@width_sidebar;
@ -150,7 +150,7 @@ fancybox{
margin-top: ~"calc(20vh - 2*@{gap})"; margin-top: ~"calc(20vh - 2*@{gap})";
} }
.m_search{ .m_search{
margin-top: 0; margin-top: 2vh;
} }
} }
&, a{ &, a{

Loading…
Cancel
Save