Merge pull request #1 from xaoxuu/master

update
i18n
冰神舞 6 years ago committed by GitHub
commit 64844c3d82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 64
      _config.yml
  2. 6
      layout/_partial/archive.ejs
  3. 95
      layout/_partial/article.ejs
  4. 5
      layout/_partial/categories.ejs
  5. 4
      layout/_partial/footer.ejs
  6. 9
      layout/_partial/head.ejs
  7. 22
      layout/_partial/header.ejs
  8. 11
      layout/_partial/post.ejs
  9. 2
      layout/_partial/post/recommended_posts.ejs
  10. 3
      layout/_partial/scripts.ejs
  11. 6
      layout/_partial/side.ejs
  12. 9
      layout/_widget/author.ejs
  13. 4
      layout/_widget/categories.ejs
  14. 22
      layout/_widget/links.ejs
  15. 5
      layout/_widget/music.ejs
  16. 4
      layout/_widget/tagcloud.ejs
  17. 5
      layout/_widget/toc.ejs
  18. 5
      source/js/app.js
  19. 82
      source/js/search.js
  20. 27
      source/less/_article.less
  21. 11
      source/less/_defines.less
  22. 9
      source/less/_header.less
  23. 83
      source/less/_main.less
  24. 51
      source/less/_toc.less
  25. 98
      source/less/_widget.less

@ -1,22 +1,25 @@
# >> 主题配置 --------------------------------------------------------------------- # >> 主题配置 ---------------------------------------------------------------------
# 字体 在这里选好你需要的字体:https://fonts.google.com,然后在_defines.less中修改font_family。
google_fonts: 'Ubuntu|Ubuntu+Mono'
# 导航栏 # 导航栏
nav_menu: nav_menu:
- name: 主页 - name: 主页
slug: about slug:
icon: fa-home icon: fas fa-home
url: / url: https://xaoxuu.com/
- name: 项目 - name: 项目
slug: projects slug:
icon: fa-cube icon: fas fa-flask
url: https://xaoxuu.com/proj url: https://xaoxuu.com/projects/
- name: 博客 - name: 博客
slug: home slug: home
icon: fa-rss icon: fas fa-rss
url: / url: /
- name: 归档 - name: 归档
slug: archives slug: archives
icon: fa-archive icon: fas fa-archive
url: /archives url: /archives/
# 右边的小窗口,不想显示哪一项的注释掉对应的即可 # 右边的小窗口,不想显示哪一项的注释掉对应的即可
widgets: widgets:
@ -24,8 +27,8 @@ widgets:
author: author:
enable: true enable: true
avatar: https://xaoxuu.com/assets/img/avatar.jpg # 头像,如果config中已经设置avatar了,这里可以不用写 avatar: https://xaoxuu.com/assets/img/avatar.jpg # 头像,如果config中已经设置avatar了,这里可以不用写
title: 某知名博主 # 博客名、头衔等等,居中显示 title: # 博客名、头衔等等,居中显示
motto: 某知名博主的座右铭啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈。 # 格言座右铭等等 motto: # 格言座右铭等等
social: true # 是否显示社交信息(内容同页脚的社交信息) social: true # 是否显示社交信息(内容同页脚的社交信息)
# 显示文章分类 # 显示文章分类
categories: true categories: true
@ -36,50 +39,23 @@ widgets:
# 显示友链 # 显示友链
links: links:
- name: xaoxuu's blog - name: xaoxuu's blog
avatar: https://xaoxuu.com/assets/img/avatar.jpg
url: https://blog.xaoxuu.com url: https://blog.xaoxuu.com
# 显示目录(在文章中设置toc:false可以隐藏单篇文章的目录) # 显示目录(在文章中设置toc:false可以隐藏单篇文章的目录)
toc: true toc: true
# 页脚社交信息 # 页脚社交信息
social: social:
- icon: fa-envelope - icon: fas fa-envelope
url: mailto:me@xaoxuu.com url: mailto:me@xaoxuu.com
- icon: fa-github - icon: fab fa-github
url: https://github.com/xaoxuu url: https://github.com/xaoxuu
- icon: fa-instagram - icon: fab fa-instagram
url: url:
- icon: fa-google-plus - icon: fab fa-twitter
url: url:
- icon: fa-twitter - icon: fas fa-music
url:
- icon: fa-music
url: https://music.163.com/#/user/home?id=63035382 url: https://music.163.com/#/user/home?id=63035382
- icon: fa-rss
url: atom
- icon: fa-telegram
url:
- icon: fa-vimeo
url:
- icon: fa-gitlab
url:
- icon: fa-linkedin
url:
- icon: fa-snapchat
url:
- icon: fa-steam
url:
- icon: fa-spotify
url:
- icon: fa-tumblr
url:
- icon: fa-youtube
url:
- icon: fa-weibo
url:
- icon: fa-weixin
url:
- icon: fa-qq
url:
# 推荐文章 # 推荐文章

@ -18,7 +18,7 @@
<article class="post revealno-title"> <article class="post revealno-title">
<section class="meta"> <section class="meta">
<h2 class="title" style="color:#EF503A"> <h2 class="title" style="color:#EF503A">
<span class="fa fa-exclamation-triangle"></span> <span class="fas fa-exclamation-triangle"></span>
还剩最后一步就成功了 还剩最后一步就成功了
</h2> </h2>
<p> <p>
@ -43,7 +43,7 @@
<% if (page.prev != 0) { %> <% if (page.prev != 0) { %>
<a class="prev" rel="prev" href="<%= url_for(page.prev_link) %>"> <a class="prev" rel="prev" href="<%= url_for(page.prev_link) %>">
<section class="post prev" > <section class="post prev" >
<i class="fa fa-chevron-left" aria-hidden="true"></i>&nbsp;上一页&nbsp; <i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;上一页&nbsp;
</section> </section>
</a> </a>
<% } %> <% } %>
@ -53,7 +53,7 @@
<% if (page.next != 0) { %> <% if (page.next != 0) { %>
<a class="next" rel="next" href="<%= url_for(page.next_link) %>"> <a class="next" rel="next" href="<%= url_for(page.next_link) %>">
<section class="post next"> <section class="post next">
&nbsp;下一页&nbsp;<i class="fa fa-chevron-right" aria-hidden="true"></i> &nbsp;下一页&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i>
</section> </section>
</a> </a>
<% } %> <% } %>

@ -1,16 +1,17 @@
<article id="<%= post.layout %>-<%= post.slug %>" class="post white-box article-type-<%= post.layout %>" itemscope itemprop="blogPost"> <article id="<%= post.layout %>-<%= post.slug %>" class="post white-box article-type-<%= post.layout %>" itemscope itemprop="blogPost">
<section class='meta'> <section class='meta'>
<h1 class="title"> <% if(post.title){ %>
<% if(post.title){ %> <h1 class="title"><%= post.title %></h1>
<%= post.title %> <% } else if (post.date) { %>
<% } else if (post.date) { %> <h1 class="title"><%= date(post.date, config.date_format) %></h1>
<%= date(post.date, config.date_format) %> <% } %>
<% } %> <time class="time">
</h1> <i class="fas fa-calendar-alt fa-fw" aria-hidden="true"></i>
<time> <%= date(post.date, config.date_format) %>
<i class="fa fa-calendar fa-fw" aria-hidden="true"></i>&nbsp;<%= date(post.date, config.date_format) %>&nbsp;&nbsp;
<i class="fa fa-eye fa-fw" aria-hidden="true"></i>&nbsp;<span id="busuanzi_value_page_pv"><i class="fa fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span>
</time> </time>
<div class="browse"><i class="fas fa-eye fa-fw" aria-hidden="true"></i>
<span id="busuanzi_value_page_pv"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span>
</div>
<%- partial('categories',{post:post}) %> <%- partial('categories',{post:post}) %>
</section> </section>
@ -20,26 +21,31 @@
<%- post.content %> <%- post.content %>
</div> </div>
<% if (post.tags && post.tags && post.tags.each) { %>
<div class="article-tags tags">
<% post.tags.each(function(item){ %>
<a href="<%- url_for(item.path) %>"><i class="fa fa-tag fa-fw" aria-hidden="true"></i>&nbsp;<%=item.name %></a>
<%})%>
</div>
<% } %>
<section class='meta'> <section class='meta'>
<time itemprop="dateUpdated" datetime="<%- moment(post.updated).format() %>" content="<%- date(post.updated, config.date_format) %>"> <time class="time" itemprop="dateUpdated" datetime="<%- moment(post.updated).format() %>" content="<%- date(post.updated, config.date_format) %>">
<i class="fa fa-pencil-square fa-fw" aria-hidden="true"></i> <i class="fas fa-pen fa-fw" aria-hidden="true"></i>
本文最后更新于:<%- date(post.updated, config.date_format) %> 本文最后更新于:<%- date(post.updated, config.date_format) %>
</time> </time>
<% if (post.tags && post.tags.length && post.tags.each) { %>
<%
var items = [];
post.tags.each(function(item){
items.push('<a class="tag" href="'+url_for(item.path)+'">' + item.name + '</a>');
});
%>
<div class="tags">
<i class="fas fa-tags fa-fw" aria-hidden="true"></i>
<%- items.join(', ') %>
</div>
<% } %>
</section> </section>
<% if(post.prev || post.next){ %> <% if(post.prev || post.next){ %>
<div class="prev-next"> <div class="prev-next">
<% if(post.prev){ %> <% if(post.prev){ %>
<section class="prev" > <section class="prev">
<span class="art-item-left"> <span class="art-item-left">
<h6><i class="fa fa-chevron-left" aria-hidden="true"></i>&nbsp;上一篇</h6> <h6><i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;上一篇</h6>
<h4> <h4>
<a href="<%=url_for(post.prev.path)%>" rel="prev" title="<%=post.prev.title%>"> <a href="<%=url_for(post.prev.path)%>" rel="prev" title="<%=post.prev.title%>">
<% if(post.prev.title){ %> <% if(post.prev.title){ %>
@ -49,11 +55,16 @@
<% } %> <% } %>
</a> </a>
</h4> </h4>
<% if (post.prev.tags && post.prev.tags.length) { %> <% if (post.prev.tags && post.prev.tags.length && post.prev.tags.each) { %>
<%
var items = [];
post.prev.tags.each(function(item){
items.push('<a class="tag" href="'+url_for(item.path)+'">' + item.name + '</a>');
});
%>
<h6 class="tags"> <h6 class="tags">
<% post.prev.tags.each(function(item){ %> <i class="fas fa-tags fa-fw" aria-hidden="true"></i>
<i class="fa fa-tag fa-fw"></i><%=item.name %> <%- items.join(', ') %>
<%})%>
</h6> </h6>
<% } %> <% } %>
</span> </span>
@ -62,7 +73,7 @@
<% if(post.next){ %> <% if(post.next){ %>
<section class="next"> <section class="next">
<span class="art-item-right" aria-hidden="true"> <span class="art-item-right" aria-hidden="true">
<h6>下一篇&nbsp;<i class="fa fa-chevron-right" aria-hidden="true"></i></h6> <h6>下一篇&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i></h6>
<h4> <h4>
<a href="<%=url_for(post.next.path)%>" rel="prev" title="<%=post.next.title%>"> <a href="<%=url_for(post.next.path)%>" rel="prev" title="<%=post.next.title%>">
<% if(post.next.title){ %> <% if(post.next.title){ %>
@ -72,11 +83,16 @@
<% } %> <% } %>
</a> </a>
</h4> </h4>
<% if (post.next.tags && post.next.tags.length) { %> <% if (post.next.tags && post.next.tags.length && post.next.tags.each) { %>
<%
var items = [];
post.next.tags.each(function(item){
items.push('<a class="tag" href="'+url_for(item.path)+'">' + item.name + '</a>');
});
%>
<h6 class="tags"> <h6 class="tags">
<% post.next.tags.each(function(item){ %> <i class="fas fa-tags fa-fw" aria-hidden="true"></i>
<i class="fa fa-tag fa-fw"></i><%=item.name %> <%- items.join(', ') %>
<%})%>
</h6> </h6>
<% } %> <% } %>
</span> </span>
@ -103,7 +119,7 @@
<% if (post.comments) { %> <% if (post.comments) { %>
<% if (config.disqus_shortname) { %> <% if (config.disqus_shortname) { %>
<h4><i class="fa fa-comments fa-fw" aria-hidden="true"></i>&nbsp;Disqus评论</h4> <h4><i class="fas fa-comments fa-fw" aria-hidden="true"></i>&nbsp;Disqus评论</h4>
<section id="comments"> <section id="comments">
<div id="disqus_thread"> <div id="disqus_thread">
无法加载评论系统,请确保您的网络能够正常访问 <a href="https://disqus.com">Disqus</a> 。 无法加载评论系统,请确保您的网络能够正常访问 <a href="https://disqus.com">Disqus</a> 。
@ -112,7 +128,7 @@
<% } %> <% } %>
<% if (config.livere_uid){ %> <% if (config.livere_uid){ %>
<h4><i class="fa fa-comments fa-fw" aria-hidden="true"></i>&nbsp;LiveRe评论</h4> <h4><i class="fas fa-comments fa-fw" aria-hidden="true"></i>&nbsp;LiveRe评论</h4>
<section id="comments"> <section id="comments">
<div id="lv-container" data-id="city" data-uid="<%= config.livere_uid %>"> <div id="lv-container" data-id="city" data-uid="<%= config.livere_uid %>">
<noscript>为正常使用来必力评论功能请激活JavaScript</noscript> <noscript>为正常使用来必力评论功能请激活JavaScript</noscript>
@ -122,18 +138,13 @@
<% if (config.valine){ %> <% if (config.valine){ %>
<% if (config.valine.enable && config.valine.appId && config.valine.appKey){ %> <% if (config.valine.enable && config.valine.appId && config.valine.appKey){ %>
<h4><i class="fa fa-comments fa-fw" aria-hidden="true"></i>&nbsp;Valine评论</h4> <h4><i class="fas fa-comments fa-fw" aria-hidden="true"></i>&nbsp;Valine评论</h4>
<div class="subtitle"> <div class="subtitle">
<h6><b>文明评论,请勿灌水。</b>为了便于区分,请您在留言时至少填写一下 <b>昵称</b> 啊。<br> <h6><b>文明评论,请勿灌水。</b>为了便于区分和接收回复提醒,请您在留言时填写一下<b>昵称</b>和<b>邮箱</b>。</h6>
与主题相关的内容及评论测试请到 <a href="https://xaoxuu.com/wiki/material-x/">https://xaoxuu.com/wiki/material-x/</a> 留言,
<% if (config.about_url){ %>
其它想要对作者说的话可以到 <a href="<%= config.about_url %>"><%= config.about_url %></a> 留言。
<% } %>
留言时填写邮箱可以在被回复时收到邮件提醒,也可以显示Gravatar头像,网址填写个人主页或者博客的作用是别人点击你的昵称会跳转到你的博客,为你增加访问量。</h6>
<div> <div>
<section id="comments"> <section id="comments">
<div id="valine_container" class="valine_thread"> <div id="valine_container" class="valine_thread">
</i><i class="fa fa-spinner fa-spin fa-fw"></i> </i><i class="fas fa-spinner fa-spin fa-fw"></i>
</div> </div>
</section> </section>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script> <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>

@ -2,10 +2,11 @@
<% <%
var cats = []; var cats = [];
post.categories.forEach(function(cat){ post.categories.forEach(function(cat){
cats.push('<a href="'+url_for(cat.path)+'">' + cat.name + '</a>'); cats.push('<a class="categories" href="'+url_for(cat.path)+'">' + cat.name + '</a>');
}); });
%> %>
<div class='cats'> <div class='cats'>
<%- cats.join(', ') %> <i class="fas fa-folder-open fa-fw" aria-hidden="true"></i>
<%- cats.join(' / ') %>
</div> </div>
<% } %> <% } %>

@ -3,7 +3,7 @@
<div class="social-wrapper"> <div class="social-wrapper">
<% (config.social||[]).forEach(function(value){ %> <% (config.social||[]).forEach(function(value){ %>
<% if (value.url && value.icon) { %> <% if (value.url && value.icon) { %>
<a href="<%= value.url %>" class="social fa <%= value.icon %> flat-box" target="_blank" rel="external"></a> <a href="<%= value.url %>" class="social <%- value.icon %> flat-box" target="_blank" rel="external"></a>
<%}%> <%}%>
<%})%> <%})%>
</div> </div>
@ -11,7 +11,7 @@
<br> <br>
<div>博客内容遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" class="licenses">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></div> <div>博客内容遵循 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" class="licenses">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></div>
<div>本站使用 <a href="https://xaoxuu.com/wiki/material-x/" target="_blank" class="codename">Material X</a> 作为主题, <div>本站使用 <a href="https://xaoxuu.com/wiki/material-x/" target="_blank" class="codename">Material X</a> 作为主题,
总访问量为 <span id="busuanzi_value_site_pv"><i class="fa fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span> 次。 总访问量为 <span id="busuanzi_value_site_pv"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span> 次。
</div> </div>
</footer> </footer>
<!-- 根据页面mathjax变量决定是否加载MathJax数学公式js --> <!-- 根据页面mathjax变量决定是否加载MathJax数学公式js -->

@ -26,8 +26,13 @@
<link rel="shortcut icon" href="<%= config.shortcut_icon %>" /> <link rel="shortcut icon" href="<%= config.shortcut_icon %>" />
<link rel="icon" href="<%= config.favicon %>" /> <link rel="icon" href="<%= config.favicon %>" />
<link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet"> <% if (config.google_fonts){ %>
<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=<%= config.google_fonts %>" rel="stylesheet">
<% } else { %>
<link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">
<% } %>
<!-- <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<link href='//cdn.bootcss.com/node-waves/0.7.5/waves.min.css' rel='stylesheet'> <link href='//cdn.bootcss.com/node-waves/0.7.5/waves.min.css' rel='stylesheet'>
<%- css('style.css') %> <%- css('style.css') %>
<script> <script>

@ -1,18 +1,14 @@
<header class="l_header"> <header class="l_header">
<div class='wrapper'> <div class='wrapper'>
<div class="nav-main container container--flex"> <div class="nav-main container container--flex">
<a class="logo flat-box" href='<%= url_for("/") %>' > <a class="logo flat-box" href='<%= url_for("/") %>' ><%- config.title %></a>
<!-- <i class="fa fa-home"></i> -->
<%- config.title %>
</a>
<div class='menu'> <div class='menu'>
<ul class='h-list'> <ul class='h-list'>
<% if (config.nav_menu) { %> <% if (config.nav_menu) { %>
<% (config.nav_menu || []).forEach(function(value){ %> <% (config.nav_menu || []).forEach(function(value){ %>
<li> <li>
<a class='nav-<%=value.slug%> flat-box' href='<%=url_for(value.url)%>'> <a class='nav-<%=value.slug%> flat-box' href='<%=url_for(value.url)%>'>
<i class='fa <%=value.icon%> fa-'></i>&nbsp;<%=value.name%> <i class='<%=value.icon%> fa-fw'></i>&nbsp;<%=value.name%>
</a> </a>
</li> </li>
<%})%> <%})%>
@ -25,24 +21,24 @@
<div class="m_search"> <div class="m_search">
<form name="searchform" class="form u-search-form"> <form name="searchform" class="form u-search-form">
<input type="text" class="input u-search-input" placeholder="Search" /> <input type="text" class="input u-search-input" placeholder="Search" />
<span class="icon"><i class="fa fa-search fa-fw"></i></span> <span class="icon"><i class="fas fa-search fa-fw"></i></span>
</form> </form>
</div> </div>
<% } %> <% } %>
<ul class='switcher h-list'> <ul class='switcher h-list'>
<% if (config.search.enable === true) { %> <% if (config.search.enable === true) { %>
<li class='s-search'><a class="fa fa-search fa-fw" href='javascript:void(0)'></span></a></li> <li class='s-search'><a class="fas fa-search fa-fw" href='javascript:void(0)'></span></a></li>
<% } %> <% } %>
<li class='s-menu'><a class="fa fa-navicon fa-fw" href='javascript:void(0)'></a></li> <li class='s-menu'><a class="fas fa-bars fa-fw" href='javascript:void(0)'></a></li>
</ul> </ul>
</div> </div>
<div class='nav-sub container container--flex'> <div class='nav-sub container container--flex'>
<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="fa fa-comments fa-fw flat-box" href='javascript:void(0)'></a></li> <li class='s-comment'><a class="fas fa-comments fa-fw flat-box" href='javascript:void(0)'></a></li>
<li class='s-top'><a class="fa fa-arrow-up fa-fw flat-box" href='javascript:void(0)'></a></li> <li class='s-top'><a class="fas fa-arrow-circle-up fa-fw flat-box" href='javascript:void(0)'></a></li>
<li class='s-toc'><a class="fa fa-list-ul fa-fw flat-box" href='javascript:void(0)'></a></li> <li class='s-toc'><a class="fas fa-list fa-fw flat-box" href='javascript:void(0)'></a></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -54,7 +50,7 @@
<% (config.nav_menu || []).forEach(function(value){ %> <% (config.nav_menu || []).forEach(function(value){ %>
<li> <li>
<a class='nav-<%=value.slug%> flat-box nav flat-box' href='<%=url_for(value.url)%>'> <a class='nav-<%=value.slug%> flat-box nav flat-box' href='<%=url_for(value.url)%>'>
<i class='fa <%=value.icon%> fa-fw'></i>&nbsp;<%=value.name%></a> <i class='<%=value.icon%> fa-fw'></i>&nbsp;<%=value.name%></a>
</li> </li>
<%})%> <%})%>
<% } %> <% } %>

@ -9,8 +9,8 @@
<% } %> <% } %>
</a> </a>
</h2> </h2>
<time> <time class="time">
<i class="fa fa-calendar fa-fw" aria-hidden="true"></i>&nbsp;<%= date(post.date, config.date_format) %> <i class="fas fa-calendar-alt fa-fw" aria-hidden="true"></i>&nbsp;<%= date(post.date, config.date_format) %>
</time> </time>
<%- partial('categories',{post:post}) %> <%- partial('categories',{post:post}) %>
</section> </section>
@ -19,14 +19,17 @@
<%- post.excerpt || post.content %> <%- post.excerpt || post.content %>
<% if (post.excerpt) { %> <% if (post.excerpt) { %>
<div class="readmore"> <div class="readmore">
<a href="<%- url_for(post.path) %>" class="flat-box">READ MORE</a> <a href="<%- url_for(post.path) %>" class="flat-box">
<i class="fas fa-book-open fa-fw" aria-hidden="true"></i>
阅读全文
</a>
</div> </div>
<% } %> <% } %>
<% if (post.tags && post.tags.length) { %> <% if (post.tags && post.tags.length) { %>
<div class="full-width auto-padding tags"> <div class="full-width auto-padding tags">
<% post.tags.each(function(item){ %> <% post.tags.each(function(item){ %>
<a href="<%- url_for(item.path) %>"><i class="fa fa-tag fa-fw"></i>&nbsp;<%=item.name %></a> <a href="<%- url_for(item.path) %>"><i class="fas fa-tag fa-fw"></i>&nbsp;<%=item.name %></a>
<%})%> <%})%>
</div> </div>
<% } %> <% } %>

@ -1,7 +1,7 @@
<% var post_list = recommended_posts(page, site) %> <% var post_list = recommended_posts(page, site) %>
<% if(post_list.length > 0) { %> <% if(post_list.length > 0) { %>
<div class="recommended_posts"> <div class="recommended_posts">
<h4><i class="fa fa-bookmark fa-fw" aria-hidden="true"></i>&nbsp;你可能感兴趣的文章</h4> <h4><i class="fas fa-bookmark fa-fw" aria-hidden="true"></i>&nbsp;你可能感兴趣的文章</h4>
<ul> <ul>
<% post_list.forEach(function(link) { %> <% post_list.forEach(function(link) { %>
<li><a href="<%= link.permalink %>"><%= link.title %></a></li> <li><a href="<%= link.permalink %>"><%= link.title %></a></li>

@ -73,7 +73,8 @@
placeholder: "<%= config.valine.placeholder %>", placeholder: "<%= config.valine.placeholder %>",
pageSize:'<%= config.valine.pageSize %>', pageSize:'<%= config.valine.pageSize %>',
avatar:'<%= config.valine.avatar %>', avatar:'<%= config.valine.avatar %>',
lang:'<%= config.valine.lang %>' lang:'<%= config.valine.lang %>',
highlight:'<%= config.valine.highlight %>'
}) })
</script> </script>
<% } %> <% } %>

@ -8,13 +8,13 @@
<% if (config.widgets.tagcloud){ %> <% if (config.widgets.tagcloud){ %>
<%- partial('../_widget/tagcloud') %> <%- partial('../_widget/tagcloud') %>
<% } %> <% } %>
<% if (config.widgets.toc){ %>
<%- partial('../_widget/toc') %>
<% } %>
<% if (config.widgets.musicid){ %> <% if (config.widgets.musicid){ %>
<%- partial('../_widget/music') %> <%- partial('../_widget/music') %>
<% } %> <% } %>
<% if (config.widgets.links){ %> <% if (config.widgets.links){ %>
<%- partial('../_widget/links') %> <%- partial('../_widget/links') %>
<% } %> <% } %>
<% if (config.widgets.toc){ %>
<%- partial('../_widget/toc') %>
<% } %>
<% } %> <% } %>

@ -2,7 +2,7 @@
<section class='m_widget author'> <section class='m_widget author'>
<% if(config.widgets.author.avatar || config.avatar) { %> <% if(config.widgets.author.avatar || config.avatar) { %>
<div class='header'> <div class='header'>
<img class='avatar' src='<%= url_for(config.widgets.author.avatar || config.avatar) %>' /> <img class='avatar' src='<%= url_for(config.widgets.author.avatar || config.avatar) %>'/>
</div> </div>
<%} %> <%} %>
<% if (config.widgets.author.title || config.widgets.author.motto){ %> <% if (config.widgets.author.title || config.widgets.author.motto){ %>
@ -11,10 +11,7 @@
<h2><%= config.widgets.author.title %></h2> <h2><%= config.widgets.author.title %></h2>
<% } %> <% } %>
<% if (config.widgets.author.motto){ %> <% if (config.widgets.author.motto){ %>
<div> <p><%= config.widgets.author.motto %></p>
<i class="fa fa-quote-left fa-3x fa-pull-left" aria-hidden="true"></i>
<%= config.widgets.author.motto %>
</div>
<% } %> <% } %>
</div> </div>
<% } %> <% } %>
@ -22,7 +19,7 @@
<div class="social-wrapper"> <div class="social-wrapper">
<% (config.social||[]).forEach(function(value){ %> <% (config.social||[]).forEach(function(value){ %>
<% if (value.url && value.icon) { %> <% if (value.url && value.icon) { %>
<a href="<%= value.url %>" class="social flat-box" target="_blank" rel="external"><i class="social fa <%= value.icon %>" aria-hidden="true"></i></a> <a href="<%= value.url %>" class="social flat-box" target="_blank" rel="external"><i class="social <%= value.icon %>" aria-hidden="true"></i></a>
<%}%> <%}%>
<%})%> <%})%>
</div> </div>

@ -1,5 +1,7 @@
<section class='m_widget categories'> <section class='m_widget categories'>
<div class='header'><i class="fa fa-sitemap fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;分类</div> <header class='header'>
<div><i class="fas fa-folder-open fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;分类</div>
</header>
<div class='content'> <div class='content'>
<% if (site.categories.length){ %> <% if (site.categories.length){ %>
<ul class="entry"> <ul class="entry">

@ -1,24 +1,24 @@
<section class='m_widget links'> <section class='m_widget links'>
<div class='header'><i class="fa fa-handshake-o fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;友链</div> <header class='header'>
<div><i class="fas fa-handshake fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;友链</div>
<% if(config.email) { %>
<a class="rightBtn" title="联系博主添加友链" target="_blank" rel="external nofollow noopener noreferrer" href="mailto:<%= config.email %>?subject=交换友链&body=你好,我想和你交换友链,我已经将【<%= config.title %>】添加到我的博客的友链中。我的博客链接是:"><i class="fas fa-plus fa-fw"></i></a>
<%} %>
</header>
<div class='content'> <div class='content'>
<ul class="entry" id="links"> <ul class="entry" id="links">
<% (config.widgets.links||[]).forEach(function(item){ %> <% (config.widgets.links||[]).forEach(function(item){ %>
<li><a class="flat-box" target="_blank" rel="external nofollow noopener noreferrer" href="<%= url_for(item.url) %>"> <li><a class="flat-box" target="_blank" rel="external nofollow noopener noreferrer" href="<%= url_for(item.url) %>">
<div class='name'> <div class='name'>
<i class="fa fa-user-circle-o fa-fw" aria-hidden="true"></i> <% if(item.avatar) { %>
<img src="<%= item.avatar %>">
<% } else { %>
<i class="fas fa-user-circle fa-fw" aria-hidden="true"></i>
<% } %>
&nbsp;&nbsp;<%= item.name %> &nbsp;&nbsp;<%= item.name %>
</div> </div>
</a></li> </a></li>
<% }) %> <% }) %>
<% if(config.email) { %>
<li><a class="flat-box" target="_blank" rel="external nofollow noopener noreferrer" href="mailto:<%= config.email %>?subject=交换友链&body=你好,我想和你交换友链,我已经将【<%= config.title %>】添加至我的博客的友链中。我的博客链接是:">
<div class='name'>
<i class="fa fa-plus fa-fw" aria-hidden="true"></i>
&nbsp;&nbsp;联系博主交换友链
</div>
</a></li>
<%} %>
</ul> </ul>
</div> </div>

@ -1,5 +1,8 @@
<section class='m_widget music'> <section class='m_widget music'>
<div class='header'><i class="fa fa-headphones fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;音乐</div> <header class='header'>
<div><i class="fas fa-headphones-alt fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;音乐</div>
<a class="rightBtn" title="打开博主的网易云音乐主页" target="_blank" rel="external nofollow noopener noreferrer" href="https://music.163.com/#/playlist?id=<%= config.widgets.musicid %>"><i class="fas fa-external-link-square-alt fa-fw"></i></a>
</header>
<div class='content'> <div class='content'>
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=100% height=450 src="//music.163.com/outchain/player?type=0&id=<%= config.widgets.musicid %>&auto=0&height=450"></iframe> <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=100% height=450 src="//music.163.com/outchain/player?type=0&id=<%= config.widgets.musicid %>&auto=0&height=450"></iframe>
</div> </div>

@ -1,6 +1,8 @@
<% if (site.tags.length){ %> <% if (site.tags.length){ %>
<section class='m_widget tagcloud'> <section class='m_widget tagcloud'>
<div class="header"><i class="fa fa-tags fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;标签</div> <header class="header">
<div><i class="fas fa-tags fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;标签</div>
</header>
<div class='content'> <div class='content'>
<%- tagcloud(site.tags, { <%- tagcloud(site.tags, {
min_font: 14, min_font: 14,

@ -1,6 +1,9 @@
<% if(page.content && page.toc!==false && toc(page.content).length > 0){ %> <% if(page.content && page.toc!==false && toc(page.content).length > 0){ %>
<section class='m_widget toc-wrapper'> <section class='m_widget toc-wrapper'>
<div class="header"><i class="fa fa-list fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;目录</div> <header class="header">
<div><i class="fas fa-list fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;目录</div>
<div class='wrapper'><a class="s-toc rightBtn" title="固定到顶部" target="_blank" rel="external nofollow noopener noreferrer" href="javascript:void(0)"><i class="fas fa-thumbtack fa-fw"></i></a></div>
</header>
<div class='content'> <div class='content'>
<%- toc(page.content, {list_number: false}) %> <%- toc(page.content, {list_number: false}) %>
</div> </div>

@ -9,6 +9,11 @@ var customSearch;
const $elem = elem.href ? $(elem.getAttribute('href')) : $(elem); const $elem = elem.href ? $(elem.getAttribute('href')) : $(elem);
$('html, body').animate({ 'scrollTop': $elem.offset().top - correction }, 400); $('html, body').animate({ 'scrollTop': $elem.offset().top - correction }, 400);
}; };
document.onkeydown = function() {
if (event.keyCode == 9) {
return false;
}
}
function setHeader() { function setHeader() {
if (!window.subData) return; if (!window.subData) return;

@ -8,7 +8,7 @@ var SearchService = "";
*/ */
SearchService = function(options) { SearchService = function(options) {
var self = this; var self = this;
self.config = $.extend({ self.config = $.extend({
per_page: 10, per_page: 10,
selectors: { selectors: {
@ -70,7 +70,7 @@ var SearchService = "";
self.dom.modal_ajax_content.removeClass('loaded'); self.dom.modal_ajax_content.removeClass('loaded');
self.startLoading(); self.startLoading();
}; };
self.afterQuery = function() { self.afterQuery = function() {
self.dom.modal_body.scrollTop(0); self.dom.modal_body.scrollTop(0);
self.dom.modal_ajax_content.addClass('loaded'); self.dom.modal_ajax_content.addClass('loaded');
@ -109,19 +109,19 @@ var SearchService = "";
self.dom.modal_error.html(errMsg); self.dom.modal_error.html(errMsg);
self.dom.modal_error.show(); self.dom.modal_error.show();
}; };
self.nextPage = function() { self.nextPage = function() {
if (self.nav.next !== -1) { if (self.nav.next !== -1) {
self.search(self.nav.next); self.search(self.nav.next);
} }
}; };
self.prevPage = function() { self.prevPage = function() {
if (self.nav.prev !== -1) { if (self.nav.prev !== -1) {
self.search(self.nav.prev); self.search(self.nav.prev);
} }
}; };
/** /**
* Generate html for one result * Generate html for one result
* @param url : (string) url * @param url : (string) url
@ -134,12 +134,12 @@ var SearchService = "";
html += "<a class='result' href='" +url+ "'>"; html += "<a class='result' href='" +url+ "'>";
html += "<span class='title'>" +title+ "</span>"; html += "<span class='title'>" +title+ "</span>";
html += "<span class='digest'>" +digest+ "</span>"; html += "<span class='digest'>" +digest+ "</span>";
html += "<span class='icon icon-chevron-thin-right'></span>"; html += "<span class='fas fa-chevron-thin-right'></span>";
html += "</a>"; html += "</a>";
html += "</li>"; html += "</li>";
return html; return html;
}; };
/** /**
* Close the modal, resume body scrolling * Close the modal, resume body scrolling
* no param * no param
@ -149,7 +149,7 @@ var SearchService = "";
self.dom.container.fadeOut(); self.dom.container.fadeOut();
self.dom.body.removeClass('modal-active'); self.dom.body.removeClass('modal-active');
}; };
/** /**
* Searchform submit event handler * Searchform submit event handler
* @param queryText : (string) the query text * @param queryText : (string) the query text
@ -161,19 +161,19 @@ var SearchService = "";
self.search(1); self.search(1);
} }
}; };
/** /**
* Start loading bar animation * Start loading bar animation
* no param * no param
*/ */
self.startLoading = function() { self.startLoading = function() {
self.dom.modal_loading_bar.show(); self.dom.modal_loading_bar.show();
self.loadingTimer = setInterval(function() { self.loadingTimer = setInterval(function() {
self.percentLoaded = Math.min(self.percentLoaded+5,95); self.percentLoaded = Math.min(self.percentLoaded+5,95);
self.dom.modal_loading_bar.css('width', self.percentLoaded+'%'); self.dom.modal_loading_bar.css('width', self.percentLoaded+'%');
}, 100); }, 100);
}; };
/** /**
* Stop loading bar animation * Stop loading bar animation
* no param * no param
@ -212,7 +212,7 @@ var SearchService = "";
self.dom.btn_prev.off('click'); self.dom.btn_prev.off('click');
self.dom.container.remove(); self.dom.container.remove();
}; };
/** /**
* Load template and register event handlers * Load template and register event handlers
* no param * no param
@ -233,7 +233,7 @@ var SearchService = "";
self.init(); self.init();
}; };
var template = '<div id="u-search"><div class="modal"> <header class="modal-header" class="clearfix"><form id="u-search-modal-form" class="u-search-form" name="uSearchModalForm"> <input type="text" id="u-search-modal-input" class="u-search-input" /> <button type="submit" id="u-search-modal-btn-submit" class="u-search-btn-submit"> <span class="icon icon-search"></span> </button></form> <a class="btn-close"> <span class="icon icon-close"></span> </a><div class="modal-loading"><div class="modal-loading-bar"></div></div> </header> <main class="modal-body"><ul class="modal-results modal-ajax-content"></ul> </main> <footer class="modal-footer clearfix"><div class="modal-metadata modal-ajax-content"> <strong class="range"></strong> of <strong class="total"></strong></div><div class="modal-error"></div> <div class="logo"></div> <a class="nav btn-next modal-ajax-content"> <span class="text">NEXT</span> <span class="icon icon-chevron-right"></span> </a> <a class="nav btn-prev modal-ajax-content"> <span class="icon icon-chevron-left"></span> <span class="text">PREV</span> </a> </footer></div><div class="modal-overlay"></div></div>'; var template = '<div id="u-search"><div class="modal"> <header class="modal-header" class="clearfix"><form id="u-search-modal-form" class="u-search-form" name="uSearchModalForm"> <input type="text" id="u-search-modal-input" class="u-search-input" /> <button type="submit" id="u-search-modal-btn-submit" class="u-search-btn-submit"> <span class="fas fa-search"></span> </button></form> <a class="btn-close"> <span class="fas fa-times"></span> </a><div class="modal-loading"><div class="modal-loading-bar"></div></div> </header> <main class="modal-body"><ul class="modal-results modal-ajax-content"></ul> </main> <footer class="modal-footer clearfix"><div class="modal-metadata modal-ajax-content"> <strong class="range"></strong> of <strong class="total"></strong></div><div class="modal-error"></div> <div class="logo"></div> <a class="nav btn-next modal-ajax-content"> <span class="text">NEXT</span> <span class="fas fa-chevron-right"></span> </a> <a class="nav btn-prev modal-ajax-content"> <span class="fas fa-chevron-left"></span> <span class="text">PREV</span> </a> </footer></div><div class="modal-overlay"></div></div>';
})(jQuery); })(jQuery);
var AlgoliaSearch; var AlgoliaSearch;
@ -250,7 +250,7 @@ var AlgoliaSearch;
var self = this; var self = this;
var endpoint = "https://" +self.config.appId+ "-dsn.algolia.net/1/indexes/" +self.config.indexName; var endpoint = "https://" +self.config.appId+ "-dsn.algolia.net/1/indexes/" +self.config.indexName;
self.addLogo('algolia'); self.addLogo('algolia');
/** /**
* Generate result list html * Generate result list html
* @param data : (array) result items * @param data : (array) result items
@ -268,7 +268,7 @@ var AlgoliaSearch;
}); });
return html; return html;
}; };
/** /**
* Generate metadata after a successful query * Generate metadata after a successful query
* @param data : (object) the raw search response data * @param data : (object) the raw search response data
@ -303,7 +303,7 @@ var AlgoliaSearch;
self.dom.btn_prev.hide(); self.dom.btn_prev.hide();
} }
}; };
/** /**
* Send a GET request * Send a GET request
* @param queryText : (string) the query text * @param queryText : (string) the query text
@ -319,7 +319,7 @@ var AlgoliaSearch;
"x-algolia-api-key": self.config.apiKey "x-algolia-api-key": self.config.apiKey
}, function(data, status) { }, function(data, status) {
if (status === 'success' && data.hits && data.hits.length > 0) { if (status === 'success' && data.hits && data.hits.length > 0) {
var results = self.buildResultList(data.hits); var results = self.buildResultList(data.hits);
self.dom.modal_results.html(results); self.dom.modal_results.html(results);
} }
else { else {
@ -331,7 +331,7 @@ var AlgoliaSearch;
} }
}); });
}; };
return self; return self;
}; };
@ -351,7 +351,7 @@ var AzureSearch;
var endpoint = "https://" +self.config.serviceName+ ".search.windows.net/indexes/" +self.config.indexName+ "/docs?api-version=2015-02-28"; var endpoint = "https://" +self.config.serviceName+ ".search.windows.net/indexes/" +self.config.indexName+ "/docs?api-version=2015-02-28";
self.nav.current = 1; self.nav.current = 1;
self.addLogo('azure'); self.addLogo('azure');
/** /**
* Generate result list html * Generate result list html
* @param data : (array) result items * @param data : (array) result items
@ -369,7 +369,7 @@ var AzureSearch;
}); });
return html; return html;
}; };
/** /**
* Generate metadata after a successful query * Generate metadata after a successful query
* @param data : (object) the raw response data * @param data : (object) the raw response data
@ -405,7 +405,7 @@ var AzureSearch;
self.dom.btn_prev.hide(); self.dom.btn_prev.hide();
} }
}; };
/** /**
* Send a GET request * Send a GET request
* @param queryText : (string) the query text * @param queryText : (string) the query text
@ -476,7 +476,7 @@ var BaiduSearch;
}); });
return html; return html;
}; };
/** /**
* Generate metadata after a successful query * Generate metadata after a successful query
* @param data : (object) the raw google custom search response data * @param data : (object) the raw google custom search response data
@ -537,7 +537,7 @@ var BaiduSearch;
}; };
self.loadScript(); self.loadScript();
return self; return self;
}; };
@ -546,7 +546,7 @@ var GoogleCustomSearch = "";
(function($) { (function($) {
'use strict'; 'use strict';
/** /**
* Search by Google Custom Search Engine JSON API * Search by Google Custom Search Engine JSON API
* @param options : (object) * @param options : (object)
@ -571,7 +571,7 @@ var GoogleCustomSearch = "";
}); });
return html; return html;
}; };
/** /**
* Generate metadata after a successful query * Generate metadata after a successful query
* @param data : (object) the raw google custom search response data * @param data : (object) the raw google custom search response data
@ -605,7 +605,7 @@ var GoogleCustomSearch = "";
self.dom.btn_prev.hide(); self.dom.btn_prev.hide();
} }
}; };
/** /**
* Send a GET request * Send a GET request
* @param queryText : (string) the query text * @param queryText : (string) the query text
@ -621,8 +621,8 @@ var GoogleCustomSearch = "";
num: self.config.per_page num: self.config.per_page
}, function(data, status) { }, function(data, status) {
if (status === 'success' && data.items && data.items.length > 0) { if (status === 'success' && data.items && data.items.length > 0) {
var results = self.buildResultList(data.items); var results = self.buildResultList(data.items);
self.dom.modal_results.html(results); self.dom.modal_results.html(results);
} }
else { else {
self.onQueryError(queryText, status); self.onQueryError(queryText, status);
@ -633,7 +633,7 @@ var GoogleCustomSearch = "";
} }
}); });
}; };
return self; return self;
}; };
})(jQuery); })(jQuery);
@ -641,7 +641,7 @@ var HexoSearch;
(function($) { (function($) {
'use strict'; 'use strict';
/** /**
* Search by Hexo generator json content * Search by Hexo generator json content
* @param options : (object) * @param options : (object)
@ -652,7 +652,7 @@ var HexoSearch;
self.config.endpoint = ROOT + ((options||{}).endpoint || "content.json"); self.config.endpoint = ROOT + ((options||{}).endpoint || "content.json");
self.config.endpoint = self.config.endpoint.replace("//","/"); //make sure the url is correct self.config.endpoint = self.config.endpoint.replace("//","/"); //make sure the url is correct
self.cache = ""; self.cache = "";
/** /**
* Search queryText in title and content of a post * Search queryText in title and content of a post
* Credit to: http://hahack.com/codes/local-search-engine-for-hexo/ * Credit to: http://hahack.com/codes/local-search-engine-for-hexo/
@ -705,7 +705,7 @@ var HexoSearch;
} }
return foundMatch; return foundMatch;
}; };
/** /**
* Generate result list html * Generate result list html
* @param data : (array) result items * @param data : (array) result items
@ -719,7 +719,7 @@ var HexoSearch;
}); });
return html; return html;
}; };
/** /**
* Generate metadata after a successful query * Generate metadata after a successful query
* @param data : (object) the raw google custom search response data * @param data : (object) the raw google custom search response data
@ -727,7 +727,7 @@ var HexoSearch;
self.buildMetadata = function(data) { self.buildMetadata = function(data) {
self.dom.modal_footer.hide(); self.dom.modal_footer.hide();
}; };
/** /**
* Send a GET request * Send a GET request
* @param queryText : (string) the query text * @param queryText : (string) the query text
@ -743,16 +743,16 @@ var HexoSearch;
start: startIndex, start: startIndex,
num: self.config.per_page num: self.config.per_page
}, function(data, status) { }, function(data, status) {
if (status !== 'success' || if (status !== 'success' ||
!data || !data ||
(!data.posts && !data.pages) || (!data.posts && !data.pages) ||
(data.posts.length < 1 && data.pages.length < 1) (data.posts.length < 1 && data.pages.length < 1)
) { ) {
self.onQueryError(queryText, status); self.onQueryError(queryText, status);
} }
else { else {
self.cache = data; self.cache = data;
var results = ""; var results = "";
results += self.buildResultList(data.pages, queryText); results += self.buildResultList(data.pages, queryText);
results += self.buildResultList(data.posts, queryText); results += self.buildResultList(data.posts, queryText);
self.dom.modal_results.html(results); self.dom.modal_results.html(results);
@ -764,7 +764,7 @@ var HexoSearch;
}); });
} }
else { else {
var results = ""; var results = "";
results += self.buildResultList(self.cache.pages, queryText); results += self.buildResultList(self.cache.pages, queryText);
results += self.buildResultList(self.cache.posts, queryText); results += self.buildResultList(self.cache.posts, queryText);
self.dom.modal_results.html(results); self.dom.modal_results.html(results);
@ -774,8 +774,8 @@ var HexoSearch;
} }
} }
}; };
return self; return self;
}; };
})(jQuery); })(jQuery);

@ -156,8 +156,8 @@
background: fade(@theme_bg_quote, 10%); background: fade(@theme_bg_quote, 10%);
margin: 1em 0; margin: 1em 0;
padding: @gap; padding: @gap;
border-left: @border_radius solid @theme_bg_quote; border-left: @border_radius_code_block solid @theme_bg_quote;
border-radius: @border_radius; border-radius: @border_radius_code_block;
.enable-trans(); .enable-trans();
footer { footer {
strong { strong {
@ -184,10 +184,9 @@
margin: 0px 2px; margin: 0px 2px;
vertical-align: center; vertical-align: center;
border-radius: 2px; border-radius: 2px;
border: 1px solid fade(@theme_bg_code, 30%); border: 1px solid fade(@theme_bg_code, 50%);
font-size: @fontsize_base * .8; font-size: @fontsize_base * .8;
background: @theme_bg_code;
background: fade(@theme_bg_code, 10%);
@media(max-width: @on_phone){ @media(max-width: @on_phone){
font-size: @fontsize_base * .8 * .95; font-size: @fontsize_base * .8 * .95;
} }
@ -210,10 +209,10 @@
border-radius: @border_radius/2; border-radius: @border_radius/2;
.enable-trans(); .enable-trans();
&:hover { &:hover {
background: darken(@theme_bg_navbar, 10%); background: darken(@theme_bg_quote, 10%);
} }
&:active { &:active {
// background: darken(@theme_bg_navbar, 20%); // background: darken(@theme_bg_quote, 20%);
} }
} }
@ -227,10 +226,12 @@
margin-top: @gap; margin-top: @gap;
background: darken(fade(@theme_bg_main, 50%), 5%); background: darken(fade(@theme_bg_main, 50%), 5%);
&.article-tags { &.article-tags {
background: transparent; // padding-top: 2*@gap;
// background: transparent;
} }
word-spacing: @gap; word-spacing: @gap;
a { a {
color: @theme_text_main;
position: relative; position: relative;
display: inline-block; display: inline-block;
word-spacing: 0; word-spacing: 0;
@ -239,7 +240,6 @@
// margin-left: @gap/2; // margin-left: @gap/2;
// } // }
.enable-trans(); .enable-trans();
color: @color_grey;
&:hover { &:hover {
color: @theme_text_highlight; color: @theme_text_highlight;
background: transparent; background: transparent;
@ -300,6 +300,7 @@
} }
h6{ h6{
margin: 0; margin: 0;
word-spacing: normal;
} }
.enable-trans(); .enable-trans();
// border: 1px solid transparent; // border: 1px solid transparent;
@ -309,8 +310,8 @@
.tags{ .tags{
background: transparent; background: transparent;
padding: 0; padding: 0;
margin-top: @gap/2; margin-top: @gap/2;
margin-bottom: 0; margin-bottom: 0;
} }
&:first-child{ &:first-child{
margin-left: 0; margin-left: 0;
@ -360,7 +361,7 @@
} }
.gutter{ .gutter{
width: 24px; width: 24px;
padding: 0 @gap/2; padding: 0 12px;
text-align: right; text-align: right;
border-width: 0; border-width: 0;
margin-left: 0; margin-left: 0;
@ -410,7 +411,7 @@
content: "SWIFT"; content: "SWIFT";
} }
&.objc .code:before{ &.objc .code:before{
content: "OBJC"; content: "OBJECTIVE-C";
} }
&.c .code:before{ &.c .code:before{
content: "C"; content: "C";

@ -55,9 +55,10 @@
// start: 字体 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // start: 字体 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// 大部分文字字体 // 大部分文字字体
@fontfamily_base: 'Ubuntu', Menlo, Monaco, Helvetica, "Hiragino Sans GB", "Hiragino Sans GB W3", Source Han Sans CN Regular, WenQuanYi Micro Hei, "Microsoft YaHei", Arial, sans-serif; @fontfamily_base: 'Ubuntu', "Source Sans Pro", "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Hiragino Sans GB W3", Menlo, Monaco, Source Han Sans CN Regular, WenQuanYi Micro Hei, "Microsoft YaHei", Arial, sans-serif;
// 代码字体 // 代码字体
@fontfamily_code: Menlo, Monaco, @fontfamily_base; // mac自带Menlo字体,windows用户需要在config中添加以下字段来加载在线字体:google_fonts: 'Ubuntu|Ubuntu+Mono'
@fontfamily_code: Menlo, 'Ubuntu Mono', Monaco, "Lucida Console", 'Source Code Pro', "Microsoft YaHei", Helvetica, Arial, sans-serif, 'Ubuntu', monospace;
// LOGO字体 // LOGO字体
@fontfamily_logo: @fontfamily_base; @fontfamily_logo: @fontfamily_base;
// end: 字体 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< // end: 字体 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -128,7 +129,7 @@
// 0px: 极端,2px:硬朗,4px:常规,8px:圆润,16px:温柔 // 0px: 极端,2px:硬朗,4px:常规,8px:圆润,16px:温柔
@border_radius: 8px; // 圆角半径,可以根据心情随时调整风格 @border_radius: 8px; // 圆角半径,可以根据心情随时调整风格
@border_radius_line: 4px; // 线的宽度和滚动条的宽度 @border_radius_line: 4px; // 线的宽度和滚动条的宽度
@border_radius_code_block: 8px; // 代码块的圆角 @border_radius_code_block: 8px; // 引用、代码块的圆角
// end: 圆角 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< // end: 圆角 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@ -145,9 +146,9 @@
// 卡片标题栏背景 // 卡片标题栏背景
@theme_bg_card_header: @theme_bg_navbar; @theme_bg_card_header: @theme_bg_navbar;
// 代码的背景色 // 代码的背景色
@theme_bg_code: fade(@color_mac_minimize, 10%); @theme_bg_code: fade(@color_ax_blue, 10%);
// 代码块的背景色 // 代码块的背景色
@theme_bg_code_block: fade(@color_mac_minimize, 10%); @theme_bg_code_block: fade(@color_ax_blue, 10%);
// 引用的颜色以及分类、归档的 hover 时颜色 // 引用的颜色以及分类、归档的 hover 时颜色
@theme_bg_quote: @theme_base_tint; @theme_bg_quote: @theme_base_tint;
// 文字颜色 ---------------- // 文字颜色 ----------------

@ -15,10 +15,12 @@
.enable-trans(); .enable-trans();
} }
.wrapper.sub{ .wrapper.sub{
.enable-trans();
transform: translateY(-@height_navbar); transform: translateY(-@height_navbar);
.logo{ .logo{
// padding-left: 0; // padding-left: 0;
@media(max-width: @on_phone){ @media(max-width: @on_phone){
.enable-trans();
padding-left: @gap; padding-left: @gap;
padding-right: 0; padding-right: 0;
font-size: @fontsize_base; font-size: @fontsize_base;
@ -223,18 +225,17 @@
line-height: 1.8em; line-height: 1.8em;
padding: 8px @gap+6px; padding: 8px @gap+6px;
} }
width: @width_sidebar;
position: fixed; position: fixed;
top: @height_navbar + @gap; top: @height_navbar + 2*@gap;
right: 0; right: 0;
width: @width_sidebar; width: ~"calc(100% - 2*@{gap})";
z-index:9999 + 1; z-index:9999 + 1;
line-height: 2 * @gap; line-height: 2 * @gap;
background: white; background: white;
border-right: 0; border-right: 0;
box-shadow: @boxshadow_card_raised; box-shadow: @boxshadow_card_raised;
border-radius: @border_radius; border-radius: @border_radius;
transform: translate3d(@width_sidebar, -0, 0); transform: translate3d(~"calc(100% + 2*@{gap})", -0, 0);
.enable-trans(); .enable-trans();
&:hover { &:hover {
box-shadow: @boxshadow_card_raised; box-shadow: @boxshadow_card_raised;

@ -47,10 +47,10 @@
border-radius: @border_radius/2; border-radius: @border_radius/2;
.enable-trans(); .enable-trans();
&:hover { &:hover {
background: darken(@theme_bg_navbar, 10%); background: darken(@theme_bg_quote, 10%);
} }
&:active { &:active {
// background: lighten(@theme_bg_navbar, 20%); // background: lighten(@theme_bg_quote, 20%);
} }
} }
blockquote{ blockquote{
@ -93,7 +93,8 @@
} }
a{ a{
&.vnick{ &.vnick{
color: @color_vue; color: #ff9800;
font-weight: bold;
&:hover { &:hover {
color: @theme_text_highlight; color: @theme_text_highlight;
text-decoration: underline; text-decoration: underline;
@ -209,10 +210,17 @@
box-shadow: @boxshadow_card_normal; box-shadow: @boxshadow_card_normal;
} }
} }
.tags a{
color: fade(@theme_text_main, 70%);
}
.meta { .meta {
color: fade(@theme_text_main, 70%);
margin-top: 2*@gap;
margin-bottom: 0.5*@gap; margin-bottom: 0.5*@gap;
font-size: @fontsize_small * .95;
&:first-child{ &:first-child{
margin-bottom: 2*@gap; margin-top: 0;
margin-bottom: 1*@gap;
} }
.title { .title {
left: 0; left: 0;
@ -238,39 +246,60 @@
} }
} }
} }
time, .tags{
.cats {
display: inline-block; display: inline-block;
background: transparent;
word-spacing: normal;
}
.time,
.cats,
.browse,
.tags {
font-size: @fontsize_small * .95; font-size: @fontsize_small * .95;
line-height: 24px;
color: fade(@theme_text_main, 70%);
display: inline-block;
background: fade(@theme_bg_quote, 10%);
margin: 0 4px 8px 0px;
padding: 2px 8px 2px 6px;
border-radius: 0.5*@border_radius_code_block;
border-left: 0.5*@border_radius_code_block solid @theme_bg_quote;
a{
color: fade(@theme_text_main, 70%);
.enable-trans();
&:hover {
color: @theme_text_highlight;
text-decoration: underline;
}
&:active {
color: darken(@theme_text_highlight, 25%);
}
}
.categories {
font-weight: normal;
color: fade(@theme_text_main, 70%);
// color: @theme_text_link;
}
.tag{
color: fade(@theme_text_main, 70%);
}
} }
.cats { .cats {
&:before {
display: inline-block;
margin: 0 5px;
@border-width: 8px;
content: '';
border-top: @border-width/2 solid transparent;
border-bottom: @border-width/2 solid transparent;
border-left: @border-width solid @theme_text_link;
}
a { a {
font-weight: bold; font-weight: bold;
color: @theme_text_link; color: @theme_text_link;
.enable-trans(); .enable-trans();
&:hover { &:hover {
color: @theme_text_highlight; color: @theme_text_highlight;
text-decoration: underline; text-decoration: underline;
} }
&:active { &:active {
color: darken(@theme_text_highlight, 25%); color: darken(@theme_text_highlight, 25%);
} }
} }
} }
time {
color: lighten(@color_grey, 20%);
}
} }
.full-width,.highlight{ .full-width,.highlight{
margin-left: 0*@gap; margin-left: 0*@gap;

@ -1,25 +1,50 @@
.m_widget.toc-wrapper{ .m_widget.toc-wrapper{
z-index: 1;
overflow: auto; overflow: auto;
border-radius: @border_radius; border-radius: @border_radius;
position: sticky; position: sticky;
top: @height_navbar + 1*@gap; top: @height_navbar + 1*@gap;
// bottom: @gap;
// max-height: ~"calc(100% - 2 * @{gap} - @{height_navbar})";
// max-height: 600px;
.enable-trans(); .enable-trans();
.header{
position: sticky;
width: 100%;
top: 0;
}
.content{ .content{
padding: @gap/2 0; padding: @gap/2 0;
padding-top: 0; // 适合白色导航栏背景
a {
border-left: 4px solid transparent;
&:hover{
color: fade(@theme_text_main, 100%);
border-left: 4px solid @theme_bg_quote;
}
&:active{
border-left: 8px solid @theme_bg_quote;
}
&.active{
color: fade(@theme_text_main, 100%);
border-left: 4px solid @theme_bg_quote;
background: fade(@theme_bg_quote, 10%);
}
}
} }
&.active{ &.active{
position: fixed; position: fixed;
box-shadow: @boxshadow_card_raised; box-shadow: @boxshadow_card_raised;
.header{
.s-toc{
display: none;
}
}
} }
.header{
position: sticky;
width: 100%;
top: 0;
}
@media(max-width: @on_phone){ @media(max-width: @on_phone){
position: fixed; position: fixed;
width: 100% - 0.5 * @gap; width: ~"calc(100% - 2 * @{gap})";
top: @height_navbar + @gap; top: @height_navbar + @gap;
left: @gap; left: @gap;
box-shadow: @boxshadow_card_raised; box-shadow: @boxshadow_card_raised;
@ -35,20 +60,6 @@
color: fade(@theme_text_main, 60%); color: fade(@theme_text_main, 60%);
font-size: @fontsize_small; font-size: @fontsize_small;
display: inline-block; display: inline-block;
border-left: 4px solid transparent;
&:hover{
color: fade(@theme_text_main, 100%);
border-left: 4px solid @theme_bg_quote;
}
&:active{
border-left: 8px solid @theme_bg_quote;
}
&.active{
color: fade(@theme_text_main, 100%);
border-left: 4px solid @theme_bg_quote;
background: fade(@theme_bg_quote, 10%);
}
} }
ol{ ol{
.toc-item.toc-level-1 { .toc-item.toc-level-1 {

@ -1,4 +1,5 @@
.m_widget{ .m_widget{
z-index: 0;
&:extend(.z-depth-main); &:extend(.z-depth-main);
background: @theme_bg_card; background: @theme_bg_card;
margin-top: @gap; margin-top: @gap;
@ -27,6 +28,8 @@
width: @width_sidebar; width: @width_sidebar;
max-height: ~"calc(100% - @{height_navbar} - 4 * @{gap})"; max-height: ~"calc(100% - @{height_navbar} - 4 * @{gap})";
.header{ .header{
display: flex;
justify-content: space-between;
border-top-left-radius: @border_radius; border-top-left-radius: @border_radius;
border-top-right-radius: @border_radius; border-top-right-radius: @border_radius;
@media(max-width: @on_phone) { @media(max-width: @on_phone) {
@ -36,44 +39,51 @@
color: @theme_text_in_header; color: @theme_text_in_header;
font-weight: bold; font-weight: bold;
line-height: 1.5em; line-height: 1.5em;
// padding: 8px @gap; // 适合深色导航栏背景 padding: 8px @gap;
padding: 14px @gap 2px @gap; // 适合白色导航栏背景 padding-top: 14px; // 适合白色导航栏背景
// letter-spacing: .08em; padding-bottom: 14px; // 适合白色导航栏背景
.rightBtn{
color: @theme_text_in_header;
&:hover {
color: darken(@theme_text_highlight, 25%);
}
}
} }
.content{ .content{
text-align: justify; text-align: justify;
padding: @gap/2; padding: @gap/2;
max-height: ~"calc(100% - @{height_navbar} - 2.5 * @{gap})"; // padding-top: 0; // 适合白色导航栏背景
max-height: ~"calc(100% - @{height_navbar} - 12.5 * @{gap})";
ul.entry > li > a{
padding: 0 @gap;
line-height:@height_cell;
height: @height_cell;
display: flex;
justify-content: space-between;
align-content: center;
border-left: 2px solid transparent;
.enable-trans();
.name{
flex:auto;
&:extend(.txt-ellipsis);
color: fade(@theme_text_main,70%);
}
.badge{
flex:none;
font-size: @fontsize_small;
color: fade(@theme_text_main, 50%);
}
&:hover{
border-left: 4px solid @theme_bg_quote;
background: fade(@theme_bg_quote, 10%);
}
&:active{
border-left: 8px solid @theme_bg_quote;
}
}
} }
ul.entry > li > a{
padding: 0 @gap;
line-height:@height_cell;
height: @height_cell;
display: flex;
justify-content: space-between;
align-content: center;
border-left: 2px solid transparent;
.enable-trans();
.name{
flex:auto;
&:extend(.txt-ellipsis);
color: fade(@theme_text_main,70%);
}
.badge{
flex:none;
font-size: @fontsize_small;
color: fade(@theme_text_main, 50%);
}
&:hover{
border-left: 4px solid @theme_bg_quote;
background: fade(@theme_bg_quote, 10%);
}
&:active{
border-left: 8px solid @theme_bg_quote;
}
}
} }
.m_widget.author{ .m_widget.author{
.enable-trans(); .enable-trans();
@ -104,8 +114,14 @@
border-top-right-radius: @border_radius; border-top-right-radius: @border_radius;
} }
.content{ .content{
p{
font-size: @fontsize_base;
text-align: center;
}
text-align: center;
font-weight: bold; font-weight: bold;
padding-bottom: 0; padding-bottom: 0;
padding: @gap/2 @gap 0 @gap;
@media(max-width: @on_phone){ @media(max-width: @on_phone){
padding: @gap/2 @gap; padding: @gap/2 @gap;
} }
@ -141,6 +157,7 @@
.m_widget.categories{ .m_widget.categories{
.content{ .content{
padding: @gap/2 0; padding: @gap/2 0;
padding-top: 0; // 适合白色导航栏背景
} }
} }
@ -148,6 +165,7 @@
.content{ .content{
text-align: justify; text-align: justify;
padding: @gap/2 @gap; padding: @gap/2 @gap;
padding-top: 0; // 适合白色导航栏背景
a{ a{
display:inline-block; display:inline-block;
.enable-trans(.1s); .enable-trans(.1s);
@ -162,15 +180,31 @@
.m_widget.contacts{ .m_widget.contacts{
.content{ .content{
padding: @gap/2 0; padding: @gap/2 0;
padding-top: 0; // 适合白色导航栏背景
} }
} }
.m_widget.music{ .m_widget.music{
.header{
padding-bottom: @gap/4; // 适合白色导航栏背景
}
.content{ .content{
padding: @gap/2; padding: @gap/2;
padding-top: 0; // 适合白色导航栏背景
} }
} }
.m_widget.links{ .m_widget.links{
.content{ .content{
padding: @gap/2 0; padding: @gap/2 0;
padding-top: 0; // 适合白色导航栏背景
.name{
img{
display: inline;
border-radius: 100%;
vertical-align: middle;
height: 18px;
width: 18px;
margin-bottom: 4px;
}
}
} }
} }

Loading…
Cancel
Save