Merge branch 'v1.2' into myblog

# Conflicts:
#	_config.yml
i18n
xaoxuu 5 years ago
commit 6f17483957
  1. 38
      _config.yml
  2. 2
      layout/_partial/article.ejs
  3. 2
      layout/_partial/footer.ejs
  4. 10
      layout/_partial/head.ejs
  5. 6
      layout/_partial/meta.ejs
  6. 37
      layout/_partial/scripts.ejs
  7. 30
      layout/_partial/side.ejs
  8. 2
      layout/_third-party/aplayer.ejs
  9. 2
      layout/_third-party/clipboard.ejs
  10. 2
      layout/_third-party/comments.ejs
  11. 4
      layout/_third-party/share.ejs
  12. 2
      layout/_widget/music.ejs
  13. 2
      layout/_widget/related_posts.ejs
  14. 24
      layout/_widget/square.ejs
  15. 2
      layout/_widget/toc.ejs
  16. 3
      layout/index.ejs
  17. 2
      layout/layout.ejs
  18. 32
      layout/list.ejs
  19. 6
      source/less/_base.less
  20. 2
      source/less/_side.less

@ -2,7 +2,14 @@
info:
name: Material X
docs: https://xaoxuu.com/wiki/material-x/
cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.6/
cdn:
css:
# style: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.6/css/style.css
js:
# app: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.6/js/app.js
# search: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.6/js/search.js
volantis: https://cdn.jsdelivr.net/gh/xaoxuu/volantis@1/js/volantis.min.js
############################### 主题样式 ###############################
@ -11,25 +18,18 @@ style: pure # pure: 导航栏和标题栏背景是白色
############################### 服务开关 ###############################
# 服务开关,如果你想禁用某些功能,直接设置为false或者注释掉,相关的js脚本就不会加载。
# 有些服务这里打开了也未必会生效,还需要额外的配置,详见文档。
services:
# cdn: true
scrollreveal: true
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
scrollreveal: true
nodewaves: true
busuanzi: true
# fastclick: true
############################### 默认值 ###############################
# 音乐控件的默认配置,如果sidebar或者page里没有提供,就取这里的参数
music:
enable: true # 是否启用
color: '#1BCDFC' # 主题色
mode: circulation # random (随机) single (单曲) circulation (列表循环) order (列表)
server: netease # netease(网易云音乐)tencent(QQ音乐) xiami(虾米) kugou(酷狗)
@ -108,7 +108,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 +142,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 +165,7 @@ social:
url: https://music.163.com/#/user/home?id=63035382
# 分享按钮
# 当id为qrcode时需要安装插件 npm i -S hexo-helper-qrcode
share:
- id: qq
name: QQ好友
@ -184,7 +185,7 @@ share:
# footer: 页脚文字,支持markdown
# footer: '页脚文字,支持[markdown](/)'
############################### 评论 ###############################
@ -193,6 +194,7 @@ share:
# valine
valine:
enable: true # 如果你想用Valine评论系统,请设置enable为true
volantis: true # 是否启用volantis版本(禁止匿名,增加若干贴吧、QQ表情)
# 还需要在根目录配置文件中添加下面这三行内容
# leancloud:
# app_id: 你的appId

@ -25,7 +25,7 @@
%>
<%- items.join(' ') %>
<% } %>
<% if (theme.services && theme.services.share == true && theme.share && (!page.meta || page.meta.share != false)) { %>
<% if (theme.share && (!page.meta || page.meta.share != false)) { %>
<%- partial('../_third-party/share') %>
<% } %>
</div>

@ -16,7 +16,7 @@
<%}%>
<br>
<div><%- markdown(__('footer.license')) %></div>
<div><%- __('footer.use') %> <a href="https://xaoxuu.com/wiki/material-x/" target="_blank" class="codename">Material X</a> <%- __('footer.theme') %><% if (theme.services && theme.services.busuanzi == true) { %><%- __('symbol.comma') %><%- __('footer.total_views') %> <span id="busuanzi_value_site_pv"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span> <%- __('footer.times') %><% } %><%- __('symbol.period') %>
<div><%- __('footer.use') %> <a href="https://xaoxuu.com/wiki/material-x/" target="_blank" class="codename">Material X</a> <%- __('footer.theme') %><% if (theme.busuanzi == true) { %><%- __('symbol.comma') %><%- __('footer.total_views') %> <span id="busuanzi_value_site_pv"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span> <%- __('footer.times') %><% } %><%- __('symbol.period') %>
</div>
</footer>
<script>setLoadingBarProgress(80);</script>

@ -46,7 +46,7 @@
<!-- link -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<% if (theme.services && theme.services.nodewaves == true) { %>
<% if (theme.nodewaves == true) { %>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-waves@0.7.6/dist/waves.min.css">
<% } %>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.6.3/css/all.min.css">
@ -58,11 +58,11 @@
<% if (config.favicon) { %>
<link rel="shortcut icon" type='image/x-icon' href="<%- url_for(config.favicon) %>">
<% } %>
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+SC" rel="stylesheet">
<% if (theme.services.cdn == true) { %>
<%- css(theme.info.cdn + 'css/style.css') %>
<% if (theme.info && theme.info.cdn && theme.info.cdn.css && theme.info.cdn.css.style) { %>
<%- css(theme.info.cdn.css.style) %>
<% } else { %>
<%- css('style.css') %>
<%- css('style.css') %>
<% } %>
<script>

@ -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;
@ -67,8 +67,8 @@
</div>
<% } %>
<% } %>
<% if(!isPostList && theme.services && (!post.meta || post.meta.counter != false)){ %>
<% if (theme.services.busuanzi == true) { %>
<% if(!isPostList && (!post.meta || post.meta.counter != false)){ %>
<% if (theme.busuanzi == true) { %>
<div class="new-meta-item browse busuanzi">
<a class='notlink'>
<i class="fas fa-eye" aria-hidden="true"></i>

@ -16,7 +16,7 @@
</script>
<% } %>
<% if (theme.services.scrollreveal == true) { %>
<% if (theme.scrollreveal == true) { %>
<script async src="https://cdn.jsdelivr.net/npm/scrollreveal@4.0.5/dist/scrollreveal.min.js"></script>
<script type="text/javascript">
$(function() {
@ -27,7 +27,7 @@
});
</script>
<% } %>
<% if (theme.services.nodewaves == true) { %>
<% if (theme.nodewaves == true) { %>
<script src="https://cdn.jsdelivr.net/npm/node-waves@0.7.6/dist/waves.min.js"></script>
<script type="text/javascript">
$(function() {
@ -41,10 +41,10 @@
});
</script>
<% } %>
<% if (theme.services.busuanzi == true) { %>
<% if (theme.busuanzi == true) { %>
<script async src="https://cdn.jsdelivr.net/gh/xaoxuu/cdn-busuanzi@2.3/js/busuanzi.pure.mini.js"></script>
<% } %>
<% if (theme.services.fastclick == true) { %>
<% if (theme.fastclick == true) { %>
<!-- fastclick -->
<script src="https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js"></script>
<script>
@ -53,17 +53,13 @@
}, false)
</script>
<% } %>
<% if (theme.services.share == true && config.mob && config.mob.app_key) { %>
<% if (page.layout == 'post' && page.share != false) { %>
<script id="-mob-share" src="//f1.webshare.mob.com/code/mob-share.js?appkey=<%- config.mob.app_key %>"></script>
<% } %>
<% } %>
<%
var enableDisqus = false;
var enableLivere = false;
var enableValine = false;
if (page && theme.services && theme.services.comments == true && page.comments != false) {
if (page && page.comments != false) {
if (config.disqus_shortname) {
enableDisqus = true;
}
@ -104,11 +100,11 @@
<% } %>
<% if (enableValine){ %>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<% if (theme.services.volantis == true) { %>
<% if (theme.services && theme.services.cdn == true) { %>
<script src="https://cdn.jsdelivr.net/gh/xaoxuu/volantis@1/js/volantis.min.js"></script>
<% if (theme.valine.volantis == true) { %>
<% if (theme.info && theme.info.cdn && theme.info.cdn.js && theme.info.cdn.js.volantis) { %>
<%- js(theme.info.cdn.js.volantis) %>
<% } else { %>
<%- js('js/volantis.js') %>
<%- js(['js/volantis.js']) %>
<% } %>
<% } else { %>
<script src="https://cdn.jsdelivr.net/gh/xaoxuu/cdn-valine@1.3.4/js/valine.min.js"></script>
@ -140,13 +136,16 @@
</script>
<% } %>
<% if (theme.services.cdn == true) { %>
<%- js([theme.info.cdn + 'js/app.js', theme.info.cdn + 'js/search.js']) %>
<% if (theme.info && theme.info.cdn && theme.info.cdn.js && theme.info.cdn.js.app) { %>
<%- js(theme.info.cdn.js.app) %>
<% } else { %>
<%- js(['js/app.js', 'js/search.js']) %>
<%- js(['js/app.js']) %>
<% } %>
<% if (theme.info && theme.info.cdn && theme.info.cdn.js && theme.info.cdn.js.search) { %>
<%- js(theme.info.cdn.js.search) %>
<% } else { %>
<%- js(['js/search.js']) %>
<% } %>
<% if (page.layout == 'links') { %>
<%- js('https://cdn.jsdelivr.net/gh/toddmotto/echo@1.7.3/src/echo.js') %>

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

@ -1,4 +1,4 @@
<% if (theme.services && theme.services.music == true) { %>
<% if (theme.music && theme.music.enable == true) { %>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.css">
<div class="aplayer"
data-theme="<%- aplayer_theme != undefined ? aplayer_theme : theme.music.color %>"

@ -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 @@
var enableDisqus = false;
var enableLivere = false;
var enableValine = false;
if (page && theme.services && theme.services.comments == true && page.comments != false) {
if (page && page.comments != false) {
if (config.disqus_shortname) {
enableDisqus = true;
}

@ -1,9 +1,9 @@
<% if (theme.services && theme.services.share == true && theme.share && page.layout == 'post' && page.share != false) { %>
<% if (theme.share && page.layout == 'post' && page.share != false) { %>
<div class="new-meta-item share -mob-share-list">
<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 %>">

@ -8,7 +8,7 @@ if (page.widget && page.widget.music == false) {
}
%>
<% if (theme.services && theme.services.music == true && needDisplay == true) { %>
<% if (theme.music && theme.music.enable == true && needDisplay == true) { %>
<section class='<%- item.widget %>'>
<%- partial('header', {item: item, defIcon: '', defTitle: ''}) %>
<div class='content <%= theme.style %>'>

@ -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.sort(page.sort ? page.sort : "-date").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