i18n
xaoxuu 5 years ago
parent dca616a21d
commit c9cb726880
  1. 10
      _config.yml
  2. 166
      layout/_partial/article.ejs
  3. 2
      layout/_widget/author.ejs
  4. 2
      layout/_widget/category.ejs
  5. 2
      layout/_widget/grid.ejs
  6. 2
      layout/_widget/list.ejs
  7. 2
      layout/_widget/music.ejs
  8. 2
      layout/_widget/plain.ejs
  9. 2
      layout/_widget/related_posts.ejs
  10. 2
      layout/_widget/tagcloud.ejs
  11. 2
      layout/_widget/toc.ejs
  12. 2
      layout/links.ejs
  13. 13
      source/less/_main.less
  14. 17
      source/less/_side.less

@ -4,10 +4,10 @@ info:
docs: https://xaoxuu.com/wiki/material-x/
cdn: # 把对应的那一行注释掉就使用本地的文件
css:
style: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.15/css/style.css
style: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.16/css/style.css
js:
app: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.15/js/app.js
search: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.15/js/search.js
app: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.16/js/app.js
search: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.16/js/search.js
volantis: https://cdn.jsdelivr.net/gh/xaoxuu/volantis@1/js/volantis.min.js
@ -121,6 +121,8 @@ meta:
header: [title, author, date, categories, counter, top]
footer: [updated, tags, share]
# 主体元素,你也可以在页面的Front-matter中设置
body: [article, comments]
# 侧边栏小部件,默认按下面给定的顺序全部显示,文章中还可以自定义显示一部分以及顺序
sidebar:
@ -165,7 +167,7 @@ sidebar:
icon: fas fa-expand-arrows-alt
url: blog/tags/
rel: nofollow
# - widget: related_posts # 需要安装插件 npm i -S hexo-related-popular-posts
- widget: related_posts # 需要安装插件 npm i -S hexo-related-popular-posts
- widget: music
icon: fas fa-compact-disc
title: "最近在听"

@ -1,86 +1,96 @@
<article id="<%= post.layout %>" class="post white-box article-type-<%= post.layout %>" itemscope itemprop="blogPost">
<%- partial('meta', {post: post, position: 'header'}) %>
<section class="article typo">
<div class="article-entry" itemprop="articleBody">
<%- post.content %>
</div>
<% if(post.layout == 'post'){ %>
<%- partial('meta', {post: post, position: 'footer'}) %>
<% } %>
<% if(post.prev || post.next){ %>
<div class="prev-next">
<% if(post.prev){ %>
<section class="prev">
<span class="art-item-left">
<h6><i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;<%- __('post.prev_page') %></h6>
<h4>
<a href="<%=url_for(post.prev.path)%>" rel="prev" title="<%=post.prev.title%>">
<% if(post.prev.title){ %>
<%= post.prev.title %>
<% } else if (post.prev.date) { %>
<%= date(post.prev.date, config.date_format) %>
<% } %>
</a>
</h4>
<% 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)+'"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>' + item.name + '</a>');
});
%>
<h6 class="tags">
<%- items.join(' ') %>
</h6>
<% } %>
</span>
</section>
<% } %>
<% if(post.next){ %>
<section class="next">
<span class="art-item-right" aria-hidden="true">
<h6><%- __('post.next_page') %>&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i></h6>
<h4>
<a href="<%=url_for(post.next.path)%>" rel="prev" title="<%=post.next.title%>">
<% if(post.next.title){ %>
<%= post.next.title %>
<% } else if (post.next.date) { %>
<%= date(post.next.date, config.date_format) %>
<% } %>
</a>
</h4>
<% 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)+'"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>' + item.name + '</a>');
});
%>
<h6 class="tags">
<%- items.join(' ') %>
</h6>
<% } %>
</span>
</section>
<%} %>
<% var sections = page.body ? page.body : theme.body; %>
<% sections.forEach(function(sectionName){ %>
<% if (sectionName == 'article') { %>
<article id="<%= post.layout %>" class="post white-box article-type-<%= post.layout %>" itemscope itemprop="blogPost">
<%- partial('meta', {post: post, position: 'header'}) %>
<section class="article typo">
<div class="article-entry" itemprop="articleBody">
<%- post.content %>
</div>
<%} %>
</section>
</article>
<% if(post.layout == 'post'){ %>
<%- partial('meta', {post: post, position: 'footer'}) %>
<% } %>
<% if(post.prev || post.next){ %>
<div class="prev-next">
<% if(post.prev){ %>
<section class="prev">
<span class="art-item-left">
<h6><i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;<%- __('post.prev_page') %></h6>
<h4>
<a href="<%=url_for(post.prev.path)%>" rel="prev" title="<%=post.prev.title%>">
<% if(post.prev.title){ %>
<%= post.prev.title %>
<% } else if (post.prev.date) { %>
<%= date(post.prev.date, config.date_format) %>
<% } %>
</a>
</h4>
<% 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)+'"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>' + item.name + '</a>');
});
%>
<h6 class="tags">
<%- items.join(' ') %>
</h6>
<% } %>
</span>
</section>
<% } %>
<% if(post.next){ %>
<section class="next">
<span class="art-item-right" aria-hidden="true">
<h6><%- __('post.next_page') %>&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i></h6>
<h4>
<a href="<%=url_for(post.next.path)%>" rel="prev" title="<%=post.next.title%>">
<% if(post.next.title){ %>
<%= post.next.title %>
<% } else if (post.next.date) { %>
<%= date(post.next.date, config.date_format) %>
<% } %>
</a>
</h4>
<% 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)+'"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>' + item.name + '</a>');
});
%>
<h6 class="tags">
<%- items.join(' ') %>
</h6>
<% } %>
</span>
</section>
<%} %>
</div>
<%} %>
</section>
</article>
<% } else if (sectionName == 'comments') { %>
<%- partial('../_third-party/' + sectionName) %>
<% } else { %>
<% theme.sidebar.forEach(function(item){ %>
<% if (item.widget == sectionName) { %>
<%- partial('../_widget/' + item.widget, {item: item}) %>
<% } %>
<% }) %>
<% } %>
<% }) %>
<!-- 根据页面mathjax变量决定是否加载MathJax数学公式js -->
<% if (page.mathjax){ %>
<%- partial('mathjax') %>
<%- partial('mathjax') %>
<% } %>
<br>
<%- partial('../_third-party/comments') %>
<script>
<% if (page.layout == 'post'){ %>
<script>
window.subData = {
title: '<%- post.title %>',
tools: true
title: '<%- post.title %>',
tools: true
}
</script>
</script>
<% } %>

@ -1,4 +1,4 @@
<section class='<%- item.widget %>'>
<section class='widget <%- item.widget %>'>
<div class='content <%= theme.style %>'>
<% if(item.avatar) { %>
<div class='avatar'>

@ -1,5 +1,5 @@
<% if (site.categories.length){ %>
<section class='<%- item.widget %>'>
<section class='widget <%- item.widget %>'>
<%- partial('header', {item: item, defIcon: 'fas fa-folder-open', defTitle: __('sidebar.category')}) %>
<div class='content <%= theme.style %>'>
<ul class="entry">

@ -1,4 +1,4 @@
<section class='<%- item.widget %>'>
<section class='widget <%- item.widget %>'>
<%- partial('header', {item: item, defIcon: '', defTitle: ''}) %>
<div class='content <%= theme.style %>'>
<ul class="grid navgation">

@ -1,4 +1,4 @@
<section class='<%- item.widget %>'>
<section class='widget <%- item.widget %>'>
<%- partial('header', {item: item, defIcon: '', defTitle: ''}) %>
<div class='content <%= theme.style %>'>
<ul class="entry">

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

@ -1,4 +1,4 @@
<section class='<%- item.widget?item.widget:'plain' %>'>
<section class='widget <%- item.widget?item.widget:'plain' %>'>
<%- partial('header', {item: item, defIcon: '', defTitle: ''}) %>
<div class='content <%= theme.style %>'>
<%- markdown(item.body) %>

@ -1,5 +1,5 @@
<% if(page.layout == 'post' && page.content && page.path != undefined){ %>
<section class='<%- item.widget %>'>
<section class='widget <%- item.widget %>'>
<%- partial('header', {item: item, defIcon: 'fas fa-bookmark', defTitle: __('sidebar.related_posts')}) %>
<div class="content <%= theme.style %>">
<%- popular_posts( { maxCount: 10 , ulClass: 'popular-posts' , PPMixingRate: 0.2 } , page ) %>

@ -1,5 +1,5 @@
<% if (site.tags.length){ %>
<section class='<%- item.widget %>'>
<section class='widget <%- item.widget %>'>
<%- partial('header', {item: item, defIcon: 'fas fa-fire', defTitle: __('sidebar.tagcloud')}) %>
<div class='content <%= theme.style %>'>
<%- tagcloud(site.tags, {

@ -1,5 +1,5 @@
<% if(page.layout == 'post' && page.content && toc(page.content).length > 0){ %>
<section class='toc-wrapper'>
<section class='widget toc-wrapper'>
<%- partial('header', {item: item, defIcon: 'fas fa-list', defTitle: __('sidebar.toc')}) %>
<div class='content <%= theme.style %>'>
<%- toc(page.content, {list_number: false}) %>

@ -43,8 +43,6 @@
</section>
</article>
<br>
<%- partial('_third-party/comments') %>
</div>

@ -277,9 +277,20 @@
}
}
.widget{
@media(max-width: @on_phone) {
border-radius: 0;
margin-left: 0;
margin-right: 0;
width: auto;
&:hover {
box-shadow: @boxshadow_card_normal;
}
}
}
.post {
position: relative;
margin: 0 auto;
margin: @gap auto;
padding: 2*@gap 1.5*@gap;
background: @theme_cardbg;
border-radius: @border_radius;

@ -8,22 +8,20 @@
width: @width_sidebar_m;
}
@media(max-width: @on_pad) {
margin: @gap 0 0;
// margin: @gap 0 0;
width: 100%;
}
}
.l_side section{
.widget{
z-index: 0;
&:extend(.z-depth-main);
background: @theme_cardbg;
margin-top: @gap;
font-family: @fontfamily_base;
font-size: @fontsize_base;
&:first-child{
margin-top: 0;
}
border-radius: @border_radius;
.enable-trans();
&:hover {
@ -33,13 +31,8 @@
box-shadow: @boxshadow_card_normal;
}
width: @width_sidebar;
@media(max-width: @on_desktop) {
width: @width_sidebar_m;
}
@media(max-width: @on_pad) {
width: 100%;
}
width: 100%;
@media(max-width: @on_phone) {
width: ~"calc(100% - 2 * @{gap})";
margin: @gap @gap 0 @gap;

Loading…
Cancel
Save