i18n 1.0.8
xaoxuu 5 years ago
parent ecffb01420
commit 43712c8b8b
  1. 2
      _config.yml
  2. 28
      layout/_partial/article.ejs
  3. 81
      layout/_partial/meta.ejs
  4. 4
      layout/_third-party/share.ejs
  5. 10
      source/less/_article.less
  6. 2
      source/less/_color.less
  7. 5
      source/less/_header.less
  8. 7
      source/less/_layout.less
  9. 136
      source/less/_main.less
  10. 3
      source/less/_normalize.less

@ -8,7 +8,7 @@ info:
name: Material X name: Material X
docs: https://xaoxuu.com/wiki/material-x/ docs: https://xaoxuu.com/wiki/material-x/
# 主题的CDN地址。如需启用CDN,请在主目录的config中设置,详见文档。 # 主题的CDN地址。如需启用CDN,请在主目录的config中设置,详见文档。
cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.2.21/ cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.2.23/
############################### 主题样式 ############################### ############################### 主题样式 ###############################

@ -6,23 +6,29 @@
</div> </div>
<% if(post.layout == 'post'){ %> <% if(post.layout == 'post'){ %>
<section class='meta' id="footer-meta"> <section class='meta' id="footer-meta">
<% if(!page.meta || page.meta.updated != false){ %> <hr>
<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> <div class='new-meta-box'>
&nbsp;<%- date(post.updated, config.date_format) %> <% if(!page.meta || page.meta.updated != false){ %>
</time> <div class="new-meta-item date" itemprop="dateUpdated" datetime="<%- moment(post.updated).format() %>">
<% } %> <a class='notlink'>
<% if (post.tags && post.tags.length && (!page.meta || page.meta.tags != false)) { %> <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 = []; var items = [];
post.tags.each(function(item){ 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(' ') %> <%- items.join(' ') %>
<% } %> <% } %>
<% if (theme.services && theme.services.share == true && (config.share || config.mob) && (!page.meta || page.meta.share != false)) { %> <% if (theme.services && theme.services.share == true && (config.share || config.mob) && (!page.meta || page.meta.share != false)) { %>
<%- partial('../_third-party/share') %> <%- partial('../_third-party/share') %>
<% } %> <% } %>
</div>
</section> </section>
<% } %> <% } %>

@ -29,35 +29,62 @@
<% } %> <% } %>
<% } %> <% } %>
<% if(post.date && (!post.meta || post.meta.date != false)){ %> <div class='new-meta-box'>
<time class="metatag time"> <% if(config.author && (!post.meta || post.meta.author != false)){ %>
<i class="fas fa-calendar-alt fa-fw" aria-hidden="true"></i>&nbsp;<%= date(post.date, config.date_format) %> <div class='new-meta-item author'>
</time> <a href="<%- url_for(config.url) %>">
<% } %> <i class="fas fa-user" aria-hidden="true"></i>
<%- config.author %>
<% if(post.categories && (!post.meta || post.meta.categories != false)){ %> </a>
<%- 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> </div>
<% } else if (theme.services.busuanzi == true) { %> <% } %>
<div class="metatag browse busuanzi"><i class="fas fa-eye fa-fw" aria-hidden="true"></i> <% if(post.date && (!post.meta || post.meta.date != false)){ %>
&nbsp;<span id="busuanzi_value_page_pv"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span> <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> </div>
<% } %> <% } %>
<% } %> <% if(post.categories && (!post.meta || post.meta.categories != false)){ %>
<% if (post.categories && post.categories.length && post.categories.forEach){ %>
<% if(isPostList && post.top && (!post.meta || post.meta.top != false)){ %> <%
<div class="metatag top"> var cats = [];
<i class="fas fa-angle-double-up fa-fw" aria-hidden="true"></i>&nbsp;<%- post.top != true ? post.top : __('post.top') %> var path;
</div> 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> </div>
</section> </section>

@ -1,6 +1,6 @@
<% if (theme.services && theme.services.share == true && (config.share || config.mob) && page.layout == 'post' && page.share != false) { %> <% if (theme.services && theme.services.share == true && (config.share || config.mob) && page.layout == 'post' && page.share != false) { %>
<div class='metatag share -mob-share-list'> <div class="new-meta-item share -mob-share-list">
<i class="left fas fa-share-alt fa-fw" aria-hidden="true"></i> <i class="fas fa-share-alt" aria-hidden="true"></i>
<div class="-mob-share-list share-body"> <div class="-mob-share-list share-body">
<% ((config.share || config.mob.list)||[]).forEach(function(item){ %> <% ((config.share || config.mob.list)||[]).forEach(function(item){ %>
<% if (item.id == 'qrcode' && theme.services.qrcode == true){ %> <% if (item.id == 'qrcode' && theme.services.qrcode == true){ %>

@ -19,11 +19,6 @@
margin: auto; margin: auto;
} }
} }
hr {
border: 0;
border-radius: 1px;
border-bottom: 1px solid rgba(0,0,0,0.1);
}
p.small-img, p.small-img,
div.small-img { div.small-img {
img { img {
@ -118,10 +113,12 @@
} }
h2 { h2 {
font-size: @fontsize_h2; font-size: @fontsize_h2;
text-align: @text_align_h2;
} }
h3 { h3 {
font-size: @fontsize_h3; font-size: @fontsize_h3;
color: darken(@color_text_main, 20%); color: @color_text_h3;
text-align: @text_align_h3;
} }
h4 { h4 {
font-weight: bold; font-weight: bold;
@ -131,7 +128,6 @@
font-weight: bold; font-weight: bold;
color: @color_text_main; color: @color_text_main;
font-size: @fontsize_h5; font-size: @fontsize_h5;
} }
h6 { h6 {
color: fade(@color_text_main, 75%); color: fade(@color_text_main, 75%);

@ -28,6 +28,8 @@
// 文字颜色 ---------------- // 文字颜色 ----------------
// 标题文字颜色(h1/h2) // 标题文字颜色(h1/h2)
@color_text_header: @theme_main; @color_text_header: @theme_main;
// 标题文字颜色(h3)
@color_text_h3: darken(@color_text_main, 20%);
// 链接颜色 // 链接颜色
@color_text_link: @color_md_deep_orange; @color_text_link: @color_md_deep_orange;
// 链接高亮颜色 // 链接高亮颜色

@ -9,7 +9,6 @@
height: @height_navbar; height: @height_navbar;
overflow: hidden; overflow: hidden;
font-family: @fontfamily_base; font-family: @fontfamily_base;
font-weight: bold;
padding: 0 @gap; padding: 0 @gap;
.wrapper{ .wrapper{
padding: auto @gap; padding: auto @gap;
@ -170,11 +169,11 @@
line-height: @height_navbar - @gap; line-height: @height_navbar - @gap;
top: 0; top: 0;
left: @gap/2; left: @gap/2;
font-size: @fontsize_small; font-size: @fontsize_base;
} }
.input { .input {
display:block; display:block;
font-size: @fontsize_small; font-size: @fontsize_base;
line-height: @height_navbar - @gap; line-height: @height_navbar - @gap;
margin: 0; margin: 0;
width: 100%; width: 100%;

@ -41,3 +41,10 @@
@border_radius_searchbar: 4px; // 搜索框的圆角半径,可以根据心情随时调整风格 @border_radius_searchbar: 4px; // 搜索框的圆角半径,可以根据心情随时调整风格
// end: 圆角 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< // end: 圆角 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// start: 文字对齐方向 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@text_align_h1: left;
@text_align_h2: left;
@text_align_h3: left;
// end: 文字对齐方向 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

@ -142,21 +142,21 @@
border-left: none; border-left: none;
} }
.vh { .vh {
border-bottom: 1px dashed fade(@color_text_main, 10%); border-bottom: 1px dashed fade(@color_text_main, 10%);
} }
} }
.vmeta{ .vmeta{
.vat{ .vat{
font-weight: bold; font-weight: bold;
color: @theme_main; color: @theme_main;
.enable-trans(); .enable-trans();
&:hover { &:hover {
color: @color_text_highlight; color: @color_text_highlight;
text-decoration: underline; text-decoration: underline;
} }
&:active { &:active {
color: darken(@color_text_highlight, 25%); color: darken(@color_text_highlight, 25%);
} }
} }
} }
.vinput{ .vinput{
@ -255,8 +255,7 @@
.post { .post {
position: relative; position: relative;
margin: 0 auto; margin: 0 auto;
padding: 2 * @gap 1.5*@gap; padding: 2*@gap 1.5*@gap;
//max-width: 768px;
background: @theme_cardbg; background: @theme_cardbg;
border-radius: @border_radius; border-radius: @border_radius;
h1{ h1{
@ -316,8 +315,10 @@
} }
.title { .title {
left: 0; // left: 0;
text-align: @text_align_h1;
font-size: @fontsize_article_title; font-size: @fontsize_article_title;
margin: 0;
@media(max-width: @on_phone) { @media(max-width: @on_phone) {
font-size: @fontsize_article_title_phone; font-size: @fontsize_article_title_phone;
} }
@ -339,92 +340,69 @@
} }
} }
} }
.tags{
display: inline-flex;
background: transparent;
word-spacing: normal;
}
@cellH: 28px; @cellH: 28px;
.metatag { .new-meta-box{
.enable-trans(); @metaH: 24px;
font-size: @fontsize_small * .95; .enable-trans();
line-height: @cellH + 1px; padding-bottom: 8px;
height: @cellH; display: flex;
align-items: center;
flex-wrap: wrap;
.new-meta-item{
color: fade(@color_text_main, 70%); color: fade(@color_text_main, 70%);
display: inline-flex; font-size: @fontsize_small * 1;
background: @theme_background; line-height: @metaH;
margin: 4px 4px 4px 0px; .notlink{
padding: 0px 8px 0px 2px; cursor: default;
border-radius: 0.5*@border_radius_code_block; &:hover{
border-left: 25px solid lighten(@theme_main, 10%); color: fade(@color_text_main, 70%);
&:hover {
background: lighten(@theme_main, 10%);
color: @color_text_in_header;
a{
color: @color_text_in_header;
}
.fas, .fab{
color: @color_text_in_header;
} }
border-left-width: 30px;
padding-right: 10px;
} }
i{ display: flex;
width: 28px; align-items: center;
line-height: @cellH; padding: 2px;
color: @color_text_in_header; margin: 4px 8px 4px 0;
margin-left: -28px; border-radius: 4px;
&:last-child{
margin-right: 0;
} }
a{ img,i{
color: fade(@color_text_main, 70%); border-radius: 100%;
.enable-trans(); display: inline;
&:hover { width: @metaH - 4px;
color: @color_text_highlight;
color: @color_text_in_header;
}
} }
.categories { img{
font-weight: normal; width: @metaH - 10px;
color: fade(@color_text_main, 70%);
} }
.tag,{ i{
color: fade(@color_text_main, 70%); margin-right: 2px;
} }
.fa-spinner{ p,a{
color: fade(@color_text_main, 70%); color: fade(@color_text_main, 70%);
margin-left: 2px; padding-left: 0;
padding-right: 4px;
}
a{
&:hover{
color: @color_text_highlight;
text-decoration: none;
}
} }
}
.share{
&:hover {
background: @theme_background;
} }
.share-body{ .share-body{
height: @metaH - 2px;
display: flex; display: flex;
a{ a{
margin-left: 4px; padding: 0;
margin-right: 4px;
img{ img{
margin: 2px 0; height: @metaH - 2px;
height: @cellH - 4px;
width: auto; width: auto;
background: transparent; background: transparent;
} }
i{
display: inline-block;
margin: 0;
padding: 0;
color: fade(@color_text_main, 70%);
}
padding-bottom: 0;
margin-bottom: 0;
&:hover{
// background: darken(@color_md_orange, 10%);
text-decoration: none;
}
} }
} }
} }
} }

@ -212,6 +212,9 @@ hr {
-moz-box-sizing: content-box; -moz-box-sizing: content-box;
box-sizing: content-box; box-sizing: content-box;
height: 0; height: 0;
border: 0;
border-radius: 1px;
border-bottom: 1px solid rgba(0,0,0,0.1);
} }
/** /**

Loading…
Cancel
Save