i18n
xaoxuu 6 years ago
parent 27068ddce0
commit 7176ffddf0
  1. 1
      _config.yml
  2. 9
      layout/_partial/article.ejs
  3. 3
      layout/_partial/post/recommended_posts.ejs
  4. 4
      layout/_partial/scripts.ejs
  5. 4
      layout/_widget/tagcloud.ejs
  6. 8
      layout/_widget/toc.ejs
  7. 8
      source/less/_base.less
  8. 3
      source/less/_defines.less
  9. 10
      source/less/_header.less
  10. 2
      source/less/_main.less
  11. 1
      source/less/_side.less
  12. 62
      source/less/_toc.less
  13. 13
      source/less/_widget.less

@ -28,6 +28,7 @@ materialx:
- contacts # 显示自己的联系信息 - contacts # 显示自己的联系信息
- music # 显示自己的网易云歌单 - music # 显示自己的网易云歌单
- links # 显示友链 - links # 显示友链
- toc # 显示目录
# 网易云音乐歌单id # 网易云音乐歌单id
widgets_musicid: widgets_musicid:
# 侧边栏的友链 # 侧边栏的友链

@ -13,14 +13,6 @@
</time> </time>
<%- partial('categories',{post:post}) %> <%- partial('categories',{post:post}) %>
</section> </section>
<% if(post.toc!==false && toc(post.content).length > 0){ %>
<section class="toc-wrapper">
<div class="header"><i class="fa fa-list" aria-hidden="true"></i>&nbsp;&nbsp;目录</div>
<div class='content'>
<%- toc(post.content, {list_number: false}) %>
</div>
</section>
<% } %>
<section class="article typo"> <section class="article typo">
@ -100,6 +92,7 @@
</i><i class="fa fa-spinner fa-spin fa-fw"></i> </i><i class="fa fa-spinner fa-spin fa-fw"></i>
</div> </div>
</section> </section>
<script src="//unpkg.com/valine/dist/Valine.min.js"></script>
<% } %> <% } %>
<% } %> <% } %>
<% } %> <% } %>

@ -1,11 +1,12 @@
<% 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" aria-hidden="true"></i>&nbsp;&nbsp;&nbsp;你可能感兴趣的文章</h4> <h4><i class="fa fa-bookmark" aria-hidden="true"></i>&nbsp;&nbsp;&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>
<% }) %> <% }) %>
</ul> </ul>
</div> </div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<% } %> <% } %>

@ -3,9 +3,7 @@
<script src="//cdn.bootcss.com/scrollReveal.js/3.3.2/scrollreveal.min.js"></script> <script src="//cdn.bootcss.com/scrollReveal.js/3.3.2/scrollreveal.min.js"></script>
<!-- 访问统计 --> <!-- 访问统计 -->
<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script> <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<!-- 推荐文章 -->
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="//unpkg.com/valine/dist/Valine.min.js"></script>
<%- js('js/jquery.fitvids.js') %> <%- js('js/jquery.fitvids.js') %>
<script> <script>

@ -1,5 +1,5 @@
<% if (site.tags.length){ %> <% if (site.tags.length){ %>
<div class="m_widget tagcloud"> <section class="m_widget tagcloud">
<div class="header"><i class="fa fa-tags" aria-hidden="true"></i>&nbsp;&nbsp;标签</div> <div class="header"><i class="fa fa-tags" aria-hidden="true"></i>&nbsp;&nbsp;标签</div>
<div class='content'> <div class='content'>
<%- tagcloud(site.tags, { <%- tagcloud(site.tags, {
@ -10,5 +10,5 @@
end_color: '#555', end_color: '#555',
}) %> }) %>
</div> </div>
</div> </section>
<% } %> <% } %>

@ -0,0 +1,8 @@
<% if(page.content && page.toc!==false && toc(page.content).length > 0){ %>
<section class="m_widget toc-wrapper">
<div class="header"><i class="fa fa-list" aria-hidden="true"></i>&nbsp;&nbsp;目录</div>
<div class='content'>
<%- toc(page.content, {list_number: false}) %>
</div>
</section>
<% } %>

@ -75,17 +75,15 @@ body {
box-shadow: 0 1px 2px 0px rgba(0, 0, 0, 0.24), 0 3px 6px 0px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 2px 0px rgba(0, 0, 0, 0.24), 0 3px 6px 0px rgba(0, 0, 0, 0.1);
} }
.z-depth-nav-raised { .z-depth-nav-raised {
// box-shadow: 0 2px 4px 0px rgba(0, 0, 0, 0.12), 0 4px 8px 0px rgba(0, 0, 0, 0.12), 0 8px 16px 0px rgba(0, 0, 0, 0.1); box-shadow: @box-shadow-card-raised;
box-shadow: 0 2px 4px 0px rgba(0, 0, 0, 0.12), 0 4px 8px 0 rgba(0, 0, 0, 0.12), 0 8px 16px 0px rgba(0, 0, 0, 0.12), 0 16px 32px 0px rgba(0, 0, 0, 0.12);
} }
.z-depth-main { .z-depth-main {
// box-shadow: 0 1.5px 3px 0 rgba(0, 0, 0, 0.12), 0 3px 6px 0 rgba(0, 0, 0, 0.08); box-shadow: @box-shadow-card-normal;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.08);
} }
.z-depth-main-raised { .z-depth-main-raised {
box-shadow: 0 2px 4px 0px rgba(0, 0, 0, 0.12), 0 4px 8px 0 rgba(0, 0, 0, 0.12), 0 8px 16px 0px rgba(0, 0, 0, 0.12), 0 16px 32px 0px rgba(0, 0, 0, 0.12); box-shadow: @box-shadow-card-raised;
} }
.z-depth-0 { .z-depth-0 {

@ -92,6 +92,9 @@
// @theme-text-main: @light; // @theme-text-main: @light;
// 自定义主题色 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< // 自定义主题色 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@box-shadow-card-raised: 0 2px 4px 0px rgba(0, 0, 0, 0.12), 0 4px 8px 0 rgba(0, 0, 0, 0.12), 0 8px 16px 0px rgba(0, 0, 0, 0.12), 0 16px 32px 0px rgba(0, 0, 0, 0.12);
@box-shadow-card-normal: 0 1px 2px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.08);
// Responsive limits // Responsive limits
@modal-threshold: 680px; @modal-threshold: 680px;

@ -109,15 +109,17 @@
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
.enable-trans(); .enable-trans();
right: 10px; left: @gap/2;
// right: @gap;
// width: 100% - 2*@gap;
top:(@header-height - @search-height)/2; top:(@header-height - @search-height)/2;
} }
&.z_search-open{ &.z_search-open{
.logo,.switcher{ .logo,.switcher{
opacity:0; // opacity:0;
} }
.m_search{ .m_search{
width: 50%; width: 100% - 1.7*@gap;
} }
} }
} }
@ -205,7 +207,7 @@
&:extend(.z-depth-main-raised); &:extend(.z-depth-main-raised);
} }
&:active { &:active {
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.08); box-shadow: @box-shadow-card-normal;
} }
nav { nav {
padding: @gap/2 0px; padding: @gap/2 0px;

@ -178,7 +178,7 @@
&:extend(.z-depth-main-raised); &:extend(.z-depth-main-raised);
} }
&:active { &:active {
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.08); box-shadow: @box-shadow-card-normal;
} }
.meta { .meta {
margin-bottom: 2*@gap; margin-bottom: 2*@gap;

@ -9,4 +9,5 @@
// box-shadow: 1px 0 3px fade(black, 10%); // box-shadow: 1px 0 3px fade(black, 10%);
} }
} }
} }

@ -1,57 +1,32 @@
.toc-wrapper{ .m_widget.toc-wrapper{
position:fixed; overflow: auto;
top: @header-height + @gap * 2;
right: 50%;
margin-right: -@container-width/2;
border-radius: @border-radius-width; border-radius: @border-radius-width;
.enable-trans(); position: fixed;
&:extend(.z-depth-main); top: @header-height + @gap;
&:hover { display: none;
&:extend(.z-depth-main-raised); &.active{
} display: block;
&:active {
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.08);
} }
max-height: ~"calc(100% - @{header-height} - 4 * @{gap})";
@media(max-width: @container-width){ @media(max-width: @container-width){
right: 0; // right: 0;
margin-right:0; // margin-right:0;
width: @side-width; // width: @side-width;
} }
@media(max-width: @on-phone){ @media(max-width: @on-phone){
width: 100% - 0.5 * @gap;
top: @header-height + @gap; top: @header-height + @gap;
right: 0px - @side-width; left: @gap;
// border-radius: 0; width: "calc(100% - 0.3 * @{gap})";
margin-right:0; display: none;
&.active{ &.active{
transform: translateX(-@side-width - 10px); display: block;
} position: fixed;
} box-shadow: @box-shadow-card-raised;
.header{
border-top-left-radius: @border-radius-width;
border-top-right-radius: @border-radius-width;
@media(max-width: @on-phone) {
border-radius: 0;
} }
background-color: fade(@theme-bg-header,90%);
color: @theme-text-in-header;
font-size: @base-font-size;
line-height: 1.8em;
padding: 8px @gap;
} }
overflow: auto;
.content{
overflow: auto;
padding: @gap/2 0;
max-height: ~"calc(100% - @{header-height} - 2.5 * @{gap})";
}
width: @side-width;
z-index:3;
&:extend(.z-depth-2);
background: @theme-bg-card;
a { a {
padding-left: 8px; padding-left: 8px;
color: fade(@theme-text-main, 50%); color: fade(@theme-text-main, 50%);
@ -102,6 +77,7 @@
padding: 0 @gap/2 0 (@gap - 5px); padding: 0 @gap/2 0 (@gap - 5px);
font-weight: bold; font-weight: bold;
width: 100%; width: 100%;
} }
width: auto; width: auto;
// &:extend(.txt-ellipsis); // &:extend(.txt-ellipsis);

@ -6,20 +6,27 @@
@media(max-width: @on-phone) { @media(max-width: @on-phone) {
border-radius: 0; border-radius: 0;
} }
width: @side-width;
max-height: ~"calc(100% - @{header-height} - 4 * @{gap})";
.enable-trans(); .enable-trans();
&:hover { &:hover {
&:extend(.z-depth-main-raised); &:extend(.z-depth-main-raised);
} }
&:active { &:active {
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.08); box-shadow: @box-shadow-card-normal;
} }
.header{ .header{
position: -webkit-sticky;
position: -moz-sticky;
position: -ms-sticky;
position: sticky;
top: 0;
border-top-left-radius: @border-radius-width; border-top-left-radius: @border-radius-width;
border-top-right-radius: @border-radius-width; border-top-right-radius: @border-radius-width;
@media(max-width: @on-phone) { @media(max-width: @on-phone) {
border-radius: 0; border-radius: 0;
} }
background-color: fade(@theme-bg-header,90%); background-color: @theme-bg-header;
color: @theme-text-in-header; color: @theme-text-in-header;
font-size: @base-font-size; font-size: @base-font-size;
line-height: 1.8em; line-height: 1.8em;
@ -28,7 +35,9 @@
} }
.content{ .content{
overflow: auto;
padding: @gap/2 0; padding: @gap/2 0;
max-height: ~"calc(100% - @{header-height} - 2.5 * @{gap})";
} }
ul.entry > li > a{ ul.entry > li > a{
padding: 0 @gap; padding: 0 @gap;

Loading…
Cancel
Save