i18n
xaoxuu 5 years ago
parent 635a289f47
commit a06b3dbf4e
  1. 7
      _config.yml
  2. 2
      layout/_partial/meta.ejs
  3. 30
      layout/_partial/side.ejs
  4. 2
      layout/_third-party/clipboard.ejs
  5. 2
      layout/_third-party/share.ejs
  6. 2
      layout/_widget/related_posts.ejs
  7. 24
      layout/_widget/square.ejs
  8. 2
      layout/_widget/toc.ejs
  9. 3
      layout/index.ejs
  10. 2
      layout/layout.ejs
  11. 32
      layout/list.ejs
  12. 6
      source/less/_base.less
  13. 2
      source/less/_side.less

@ -19,12 +19,10 @@ services:
nodewaves: true
busuanzi: true
# fastclick: true
# popular_posts: true # 需要安装插件 hexo-related-popular-posts
comments: true
volantis: true
# music: true
# share: true
# qrcode: true # 需要安装插件 npm i -S hexo-helper-qrcode
############################### 默认值 ###############################
@ -108,7 +106,7 @@ sidebar:
avatar: https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/avatar/avatar.png
social: true
- widget: toc
- widget: list
- widget: square
icon: fas fa-map-signs
title: 站内导航
rows:
@ -142,7 +140,7 @@ sidebar:
more:
icon: fas fa-expand-arrows-alt
url: blog/tags/
- widget: related_posts
- widget: related_posts # 需要安装插件 npm i -S hexo-related-popular-posts
- widget: music
icon: fas fa-compact-disc
title: "最近在听"
@ -165,6 +163,7 @@ social:
url: https://music.163.com/#/user/home?id=63035382
# 分享按钮
# 当id为qrcode时需要安装插件 npm i -S hexo-helper-qrcode
share:
- id: qq
name: QQ好友

@ -1,4 +1,4 @@
<% if(is_home() || is_category() || is_archive() || is_tag()) {
<% if(is_home() || is_category() || is_archive() || is_tag() || page.index) {
var isPostList = true;
} else {
var isPostList = false;

@ -1,15 +1,29 @@
<aside class='l_side'>
<% if (theme.sidebar && theme.sidebar.length){ %>
<%
let supportWidgets = ['author', 'category', 'list', 'music', 'tagcloud', 'toc', 'plain', 'related_posts'];
let supportWidgets = ['author', 'category', 'list', 'music', 'tagcloud', 'toc', 'plain', 'related_posts', 'square'];
%>
<% theme.sidebar.forEach(function(item){ %>
<% if (item.enable != false){ %>
<% let widget_name = item.widget ? item.widget : 'plain'; %>
<% if (supportWidgets.indexOf(widget_name) > -1){ %>
<%- partial('../_widget/' + item.widget, {item: item}) %>
<% if (page.sidebar){ %>
<% page.sidebar.forEach(function(name){ %>
<% theme.sidebar.forEach(function(item){ %>
<% let widget_name = item.widget ? item.widget : 'plain'; %>
<% if (item.enable != false && widget_name == name){ %>
<% if (supportWidgets.indexOf(widget_name) > -1){ %>
<%- partial('../_widget/' + item.widget, {item: item}) %>
<% } %>
<% } %>
<% }) %>
<% }) %>
<% } else { %>
<% theme.sidebar.forEach(function(item){ %>
<% if (item.enable != false){ %>
<% let widget_name = item.widget ? item.widget : 'plain'; %>
<% if (supportWidgets.indexOf(widget_name) > -1){ %>
<%- partial('../_widget/' + item.widget, {item: item}) %>
<% } %>
<% } %>
<% } %>
<% }) %>
<% }) %>
<% } %>
<% } %>
</aside>

@ -8,7 +8,7 @@
var initCopyCode = function(){
var copyHtml = '';
copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
copyHtml += ' <i class="fa fa-copy"></i><span>Copy</span>';
copyHtml += ' <i class="fa fa-copy"></i><span><%- __('post.copy_button') %></span>';
copyHtml += '</button>';
$(".highlight .code pre").before(copyHtml);
var clipboard = new ClipboardJS('.btn-copy', {

@ -3,7 +3,7 @@
<i class="fas fa-share-alt" aria-hidden="true"></i>
<div class="-mob-share-list share-body">
<% (theme.share||[]).forEach(function(item){ %>
<% if (item.id == 'qrcode' && theme.services.qrcode == true){ %>
<% if (item.id == 'qrcode'){ %>
<a class='qrcode' rel="external nofollow noopener noreferrer" href='<%- qrcode(url) %>'>
<% if (item.img){ %>
<img src="<%- item.img %>">

@ -1,4 +1,4 @@
<% if(theme.services && theme.services.popular_posts == true && page.layout == 'post' && page.content && page.path){ %>
<% if(page.layout == 'post' && page.content && page.path){ %>
<section class='<%- item.widget %>'>
<%- partial('header', {item: item, defIcon: 'fas fa-bookmark', defTitle: __('sidebar.related_posts')}) %>
<div class="content <%= theme.style %>">

@ -0,0 +1,24 @@
<section class='<%- item.widget %>'>
<%- partial('header', {item: item, defIcon: '', defTitle: ''}) %>
<div class='content <%= theme.style %>'>
<ul class="entry">
<% (item.rows||[]).forEach(function(row){ %>
<li><a class="flat-box" title="<%- url_for(row.url) %>" href="<%- url_for(row.url) %>">
<div class='name'>
<% if(row.img) { %>
<img src="<%- row.img %>">
<% } else if(row.avatar) { %>
<img src="<%- row.avatar %>" id="round">
<% } else { %>
<i class="<%= row.icon %> fa-fw" aria-hidden="true"></i>
<% } %>
&nbsp;&nbsp;<%- row.name %>
</div>
<% if(row.desc) { %>
<div class='badge'>(<%- row.desc %>)</div>
<% } %>
</a></li>
<% }) %>
</ul>
</div>
</section>

@ -1,4 +1,4 @@
<% if(page.layout == 'post' && page.content && page.toc!==false && toc(page.content).length > 0){ %>
<% if(page.layout == 'post' && page.content && toc(page.content).length > 0){ %>
<section class='toc-wrapper'>
<%- partial('header', {item: item, defIcon: 'fas fa-list', defTitle: __('sidebar.toc')}) %>
<div class='content <%= theme.style %>'>

@ -1,4 +1,3 @@
<% if (page.prev == 0) { %>
<div class="home-wrapper">
<div class='home-cover'>
@ -44,7 +43,7 @@
<%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %>
<% } %>
<div class="l_body" id='posts'>
<div class='container clearfix'>
<div class='body-wrapper clearfix'>
<div class='l_main'>
<%- partial('_partial/archive') %>
</div>

@ -7,7 +7,7 @@
<% } else { %>
<%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %>
<div class="l_body">
<div class='container clearfix'>
<div class='body-wrapper clearfix'>
<%- body %>
<script>setLoadingBarProgress(60);</script>
</div>

@ -0,0 +1,32 @@
<div class='l_main'>
<% if (site.posts && site.posts.length > 0) { %>
<section class="post-list">
<% site.posts.each(function(p){ %>
<% if (p.type == page.type) { %>
<div class='post-wrapper'>
<%- partial('_partial/post', {post: p, index: false}) %>
</div>
<% } %>
<% }) %>
</section>
<% if (page && page.posts) { %>
<!-- 根据主题中的设置决定是否在archive中针对摘要部分的MathJax公式加载mathjax.js文件 -->
<%
var need_mathjax = false;
page.posts.each(function(post){
if (post.mathjax){
if (post.mathjax != "internal") {
need_mathjax = true;
}
}
});
%>
<% if (need_mathjax){ %>
<%- partial('mathjax') %>
<% } %>
<% } %>
<% } %>
</div>
<%- partial('_partial/side') %>
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %>

@ -451,11 +451,15 @@ ul.h-list {
}
}
.container {
.body-wrapper {
position: relative;
display: flex;
width: 100%;
max-width: @width_container;
margin: 0 auto;
flex-wrap: wrap;
justify-content: space-between;
align-items: stretch;
}
.container--flex {

@ -223,7 +223,7 @@
}
}
&.list{
&.list, &.square{
.content{
padding: @gap/2 0;
&.pure{

Loading…
Cancel
Save