Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xaoxuu committed Feb 23, 2019
1 parent ecffb01 commit 43712c8
Show file tree
Hide file tree
Showing 10 changed files with 148 additions and 130 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ info:
name: Material X
docs: https://xaoxuu.com/wiki/material-x/
# 主题的CDN地址。如需启用CDN,请在主目录的config中设置,详见文档。
cdn: https://cdn.jsdelivr.net/gh/xaoxuu/[email protected].21/
cdn: https://cdn.jsdelivr.net/gh/xaoxuu/[email protected].23/


############################### 主题样式 ###############################
Expand Down
28 changes: 17 additions & 11 deletions layout/_partial/article.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,29 @@
</div>
<% if(post.layout == 'post'){ %>
<section class='meta' id="footer-meta">
<% if(!page.meta || page.meta.updated != false){ %>
<time class="metatag time" itemprop="dateUpdated" datetime="<%- moment(post.updated).format() %>" content="<%- date(post.updated, config.date_format) %>"><i class="fas fa-pencil-alt fa-fw" aria-hidden="true"></i>
&nbsp;<%- date(post.updated, config.date_format) %>
</time>
<% } %>
<% if (post.tags && post.tags.length && (!page.meta || page.meta.tags != false)) { %>
<hr>
<div class='new-meta-box'>
<% if(!page.meta || page.meta.updated != false){ %>
<div class="new-meta-item date" itemprop="dateUpdated" datetime="<%- moment(post.updated).format() %>">
<a class='notlink'>
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
<%- date(post.updated, config.date_format) %>
</a>
</div>
<% } %>
<% if (post.tags && post.tags.length && (!page.meta || page.meta.tags != false)) { %>
<%
var items = [];
post.tags.each(function(item){
items.push('<div class="metatag tags"><a class="tag" href="'+url_for(item.path)+'"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>&nbsp;' + item.name + '</a></div>');
items.push('<div class="new-meta-item meta-tags"><a class="tag" href="'+url_for(item.path)+'"><i class="fas fa-hashtag" aria-hidden="true"></i>&nbsp;' + item.name + '</a></div>');
});
%>
<%- items.join(' ') %>
<% } %>
<% if (theme.services && theme.services.share == true && (config.share || config.mob) && (!page.meta || page.meta.share != false)) { %>
<%- partial('../_third-party/share') %>
<% } %>
<% } %>
<% if (theme.services && theme.services.share == true && (config.share || config.mob) && (!page.meta || page.meta.share != false)) { %>
<%- partial('../_third-party/share') %>
<% } %>
</div>
</section>
<% } %>

Expand Down
81 changes: 54 additions & 27 deletions layout/_partial/meta.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,62 @@
<% } %>
<% } %>

<% if(post.date && (!post.meta || post.meta.date != false)){ %>
<time class="metatag time">
<i class="fas fa-calendar-alt fa-fw" aria-hidden="true"></i>&nbsp;<%= date(post.date, config.date_format) %>
</time>
<% } %>

<% if(post.categories && (!post.meta || post.meta.categories != false)){ %>
<%- partial('categories',{post:post}) %>
<% } %>

<% if(!isPostList && theme.services && (!post.meta || post.meta.counter != false)){ %>
<% if (theme.services.leancloud_visitors == true && config.leancloud_visitors && config.leancloud_visitors.app_id && config.leancloud_visitors.app_key) { %>
<div class="metatag browse leancloud"><i class="fas fa-eye fa-fw" aria-hidden="true"></i>
<span id="<%= url_for(page.path) %>" class="leancloud_visitors" data-flag-title="<%= page.title %>">
&nbsp;<span class="leancloud-visitors-count"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span>
</span>
<div class='new-meta-box'>
<% if(config.author && (!post.meta || post.meta.author != false)){ %>
<div class='new-meta-item author'>
<a href="<%- url_for(config.url) %>">
<i class="fas fa-user" aria-hidden="true"></i>
<%- config.author %>
</a>
</div>
<% } else if (theme.services.busuanzi == true) { %>
<div class="metatag browse busuanzi"><i class="fas fa-eye fa-fw" aria-hidden="true"></i>
&nbsp;<span id="busuanzi_value_page_pv"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span>
<% } %>
<% if(post.date && (!post.meta || post.meta.date != false)){ %>
<div class="new-meta-item date">
<a class='notlink'>
<i class="fas fa-calendar-alt" aria-hidden="true"></i>
<%= date(post.date, config.date_format) %>
</a>
</div>
<% } %>
<% } %>

<% if(isPostList && post.top && (!post.meta || post.meta.top != false)){ %>
<div class="metatag top">
<i class="fas fa-angle-double-up fa-fw" aria-hidden="true"></i>&nbsp;<%- post.top != true ? post.top : __('post.top') %>
</div>
<% } %>

<% if(post.categories && (!post.meta || post.meta.categories != false)){ %>
<% if (post.categories && post.categories.length && post.categories.forEach){ %>
<%
var cats = [];
var path;
post.categories.forEach(function(cat){
cats.push(cat.name);
path = cat.path;
});
%>
<div class='new-meta-item category'>
<a href='<%- url_for(path) %>'>
<i class="fas fa-folder-open" aria-hidden="true"></i>
<%- cats.join('&nbsp;/&nbsp;') %>
</a>
</div>
<% } %>
<% } %>
<% if(!isPostList && theme.services && (!post.meta || post.meta.counter != false)){ %>
<% if (theme.services.busuanzi == true) { %>
<div class="new-meta-item browse busuanzi">
<a class='notlink'>
<i class="fas fa-eye" aria-hidden="true"></i>
<span id="busuanzi_value_page_pv">
<i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i>
</span>
</a>
</div>
<% } %>
<% } %>
<% if(isPostList && post.top && (!post.meta || post.meta.top != false)){ %>
<div class="new-meta-item top-post">
<a class='notlink'>
<i class="fas fa-angle-double-up" aria-hidden="true"></i>
<%- post.top != true ? post.top : __('post.top') %>
</a>
</div>
<% } %>
</div>
<hr>
</div>
</section>
4 changes: 2 additions & 2 deletions layout/_third-party/share.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% if (theme.services && theme.services.share == true && (config.share || config.mob) && page.layout == 'post' && page.share != false) { %>
<div class='metatag share -mob-share-list'>
<i class="left fas fa-share-alt fa-fw" aria-hidden="true"></i>
<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">
<% ((config.share || config.mob.list)||[]).forEach(function(item){ %>
<% if (item.id == 'qrcode' && theme.services.qrcode == true){ %>
Expand Down
10 changes: 3 additions & 7 deletions source/less/_article.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
margin: auto;
}
}
hr {
border: 0;
border-radius: 1px;
border-bottom: 1px solid rgba(0,0,0,0.1);
}
p.small-img,
div.small-img {
img {
Expand Down Expand Up @@ -118,10 +113,12 @@
}
h2 {
font-size: @fontsize_h2;
text-align: @text_align_h2;
}
h3 {
font-size: @fontsize_h3;
color: darken(@color_text_main, 20%);
color: @color_text_h3;
text-align: @text_align_h3;
}
h4 {
font-weight: bold;
Expand All @@ -131,7 +128,6 @@
font-weight: bold;
color: @color_text_main;
font-size: @fontsize_h5;

}
h6 {
color: fade(@color_text_main, 75%);
Expand Down
2 changes: 2 additions & 0 deletions source/less/_color.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
// 文字颜色 ----------------
// 标题文字颜色(h1/h2)
@color_text_header: @theme_main;
// 标题文字颜色(h3)
@color_text_h3: darken(@color_text_main, 20%);
// 链接颜色
@color_text_link: @color_md_deep_orange;
// 链接高亮颜色
Expand Down
5 changes: 2 additions & 3 deletions source/less/_header.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
height: @height_navbar;
overflow: hidden;
font-family: @fontfamily_base;
font-weight: bold;
padding: 0 @gap;
.wrapper{
padding: auto @gap;
Expand Down Expand Up @@ -170,11 +169,11 @@
line-height: @height_navbar - @gap;
top: 0;
left: @gap/2;
font-size: @fontsize_small;
font-size: @fontsize_base;
}
.input {
display:block;
font-size: @fontsize_small;
font-size: @fontsize_base;
line-height: @height_navbar - @gap;
margin: 0;
width: 100%;
Expand Down
7 changes: 7 additions & 0 deletions source/less/_layout.less
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,10 @@

@border_radius_searchbar: 4px; // 搜索框的圆角半径,可以根据心情随时调整风格
// end: 圆角 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


// start: 文字对齐方向 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@text_align_h1: left;
@text_align_h2: left;
@text_align_h3: left;
// end: 文字对齐方向 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Loading

0 comments on commit 43712c8

Please sign in to comment.