i18n
xaoxuu 5 years ago
parent fd68277d88
commit 8633c59e68
  1. 14
      _config.yml
  2. 138
      layout/_partial/archive.ejs
  3. 29
      layout/archive.ejs
  4. 75
      layout/blog.ejs
  5. 30
      layout/category.ejs
  6. 11
      layout/index.ejs
  7. 32
      layout/tag.ejs

@ -62,7 +62,7 @@ home_cover:
url: https://xaoxuu.com/projects/
- name: 归档
icon: fas fa-archive
url: archives/
url: blog/archives/
- name: 关于
icon: fas fa-info-circle
url: about/
@ -71,13 +71,13 @@ home_cover:
menu:
- name: Cocoa Dev
icon: fab fa-apple
url: categories/cocoa-dev/
url: blog/categories/cocoa-dev/
- name: Dev
icon: fas fa-laptop-code
url: categories/dev/
url: blog/categories/dev/
- name: Life
icon: fas fa-coffee
url: categories/life/
url: blog/categories/life/
# 侧边栏小部件
@ -95,7 +95,7 @@ sidebar:
url: https://xaoxuu.com/projects/
- name: 文章归档
icon: fas fa-archive
url: archives/
url: blog/archives/
- name: 我的友链
icon: fas fa-link
url: friends/
@ -108,12 +108,12 @@ sidebar:
- widget: category
more:
icon: fas fa-expand-arrows-alt
url: categories/
url: blog/categories/
- widget: tagcloud
icon: fas fa-fire
more:
icon: fas fa-expand-arrows-alt
url: tags/
url: blog/tags/
- widget: related_posts
- widget: music
icon: fas fa-compact-disc

@ -1,6 +1,4 @@
<% if (site.posts && site.posts.length > 0) { %>
<section class="post-list">
<% if (page.prev == 0) { %>
<% site.posts.each(function(post){ %>
@ -11,65 +9,6 @@
<% } %>
<% }) %>
<% } %>
<% if (is_current('categories') && !page.posts) { %>
<div class='post-wrapper'>
<article id="archive-page" class="post article white-box">
<section class="archive">
<div class="archive-item archive-year mark">
<h2><%- page.title %></h2>
<hr>
</div>
<div class="archive-item archive-post mark">
<% if (site.categories.length){ %>
<% site.categories.sort('path').each(function(category){ %>
<a class="<%= category.parent ? ' child' : ''%>" href="<%= url_for(category.path) %>">
<time><i class='fas fa-folder-open fa-fw' aria-hidden="true"></i>&nbsp;&nbsp;<%= category.name %></time>
<span class="title">
(<%- category.posts.length %>)
</span>
</a>
<% }) %>
<% } %>
</div>
<br>
<%- page.content %>
</section>
</article>
</div>
<% } %>
<% if (is_current('tags') && !page.posts) { %>
<div class='post-wrapper'>
<article id="archive-page" class="post article white-box">
<section class="archive">
<div class="archive-item archive-year mark">
<h2><%- page.title %></h2>
<hr>
</div>
<div class="archive-item archive-post mark">
<% if (site.tags.length){ %>
<% site.tags.sort('path').each(function(tags){ %>
<% if (tags.posts.length){ %>
<a class="<%= tags.parent ? ' child' : ''%>" href="<%= url_for(tags.path) %>">
<time><i class='fas fa-hashtag fa-fw' aria-hidden="true"></i>&nbsp;&nbsp;<%= tags.name %></time>
<span class="title">
(<%- tags.posts.length %>)
</span>
</a>
<% } %>
<% }) %>
<% } %>
</div>
<br>
<%- page.content %>
</section>
</article>
</div>
<% } %>
<% if (page.posts && page.posts.length > 0) { %>
<% page.posts.each(function(post){ %>
<% if (!post.top) { %>
@ -79,55 +18,48 @@
<% } %>
<% }) %>
<% } %>
</section>
<% } %>
<% if (page.posts && page.posts.length > 0) { %>
<% if (page.total > 1) { %>
<% if (page && page.posts) { %>
<% if (page.total > 1) { %>
<br>
<div class="prev-next">
<div class="prev-next">
<% if (page.prev != 0) { %>
<a class="prev" rel="prev" href="<%= url_for(page.prev_link) %>">
<section class="post prev" >
<i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;<%- __('post.prev_page') %>&nbsp;
</section>
</a>
<% } %>
<p class="current">
<%= page.current%> / <%= page.total%>
</p>
<% if (page.next != 0) { %>
<a class="next" rel="next" href="<%= url_for(page.next_link) %>">
<section class="post next">
&nbsp;<%- __('post.next_page') %>&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i>
</section>
</a>
<% } %>
<div class="prev-next">
<% if (page.prev != 0) { %>
<a class="prev" rel="prev" href="<%= url_for(page.prev_link) %>">
<section class="post prev" >
<i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;<%- __('post.prev_page') %>&nbsp;
</section>
</a>
<% } %>
<p class="current">
<%= page.current%> / <%= page.total%>
</p>
<% if (page.next != 0) { %>
<a class="next" rel="next" href="<%= url_for(page.next_link) %>">
<section class="post next">
&nbsp;<%- __('post.next_page') %>&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i>
</section>
</a>
<% } %>
</div>
</div>
</div>
<% } %>
<!-- 根据主题中的设置决定是否在archive中针对摘要部分的MathJax公式加载mathjax.js文件 -->
<%
var need_mathjax = false;
page.posts.each(function(post){
if (post.mathjax){
if (post.mathjax != "internal") {
need_mathjax = true;
<% } %>
<!-- 根据主题中的设置决定是否在archive中针对摘要部分的MathJax公式加载mathjax.js文件 -->
<%
var need_mathjax = false;
page.posts.each(function(post){
if (post.mathjax){
if (post.mathjax != "internal") {
need_mathjax = true;
}
}
}
});
%>
});
%>
<% if (need_mathjax){ %>
<%- partial('mathjax') %>
<% } %>
<% if (need_mathjax){ %>
<%- partial('mathjax') %>
<% } %>
<% } %>

@ -49,19 +49,20 @@
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %>
<% if (page && page.posts) { %>
<!-- 根据主题中的设置决定是否在archive中针对摘要部分的MathJax公式加载mathjax.js文件 -->
<%
var need_mathjax = false;
page.posts.each(function(post){
if (post.mathjax){
if (post.mathjax != "internal") {
need_mathjax = true;
}
}
});
%>
<!-- 根据主题中的设置决定是否在archive中针对摘要部分的MathJax公式加载mathjax.js文件 -->
<%
var need_mathjax = false;
page.posts.each(function(post){
if (post.mathjax){
if (post.mathjax != "internal") {
need_mathjax = true;
}
}
});
%>
<% if (need_mathjax){ %>
<%- partial('_partial/mathjax') %>
<% if (need_mathjax){ %>
<%- partial('_partial/mathjax') %>
<% } %>
<% } %>

@ -1,75 +0,0 @@
<div class='l_main'>
<% if (site.posts && site.posts.length > 0) { %>
<section class="post-list">
<% if (page.prev == 0) { %>
<% site.posts.each(function(post){ %>
<% if (post.top) { %>
<div class='post-wrapper'>
<%- partial('_partial/post', {post: post}) %>
</div>
<% } %>
<% }) %>
<% } %>
<% site.posts.sort(config.index_generator.order_by).each(function(post){ %>
<% if (!post.top) { %>
<div class='post-wrapper'>
<%- partial('_partial/post', {post: post}) %>
</div>
<% } %>
<% }) %>
</section>
<% if (page.total > 1) { %>
<br>
<div class="prev-next">
<div class="prev-next">
<% if (page.prev != 0) { %>
<a class="prev" rel="prev" href="<%= url_for(page.prev_link) %>">
<section class="post prev" >
<i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;<%- __('post.prev_page') %>&nbsp;
</section>
</a>
<% } %>
<p class="current">
<%= page.current%> / <%= page.total%>
</p>
<% if (page.next != 0) { %>
<a class="next" rel="next" href="<%= url_for(page.next_link) %>">
<section class="post next">
&nbsp;<%- __('post.next_page') %>&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i>
</section>
</a>
<% } %>
</div>
</div>
<% } %>
<% } %>
<% if (page.posts && page.posts.length > 0) { %>
<!-- 根据主题中的设置决定是否在archive中针对摘要部分的MathJax公式加载mathjax.js文件 -->
<%
var need_mathjax = false;
page.posts.each(function(post){
if (post.mathjax){
if (post.mathjax != "internal") {
need_mathjax = true;
}
}
});
%>
<% if (need_mathjax){ %>
<%- partial('_partial/mathjax') %>
<% } %>
<% } %>
</div>
<%- partial('_partial/side') %>
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %>

@ -1,6 +1,32 @@
<div class='l_main'>
<%- partial('_partial/archive') %>
<% if (site.posts && site.posts.length > 0) { %>
<section class="post-list">
<div class='post-wrapper'>
<article id="archive-page" class="post article white-box">
<section class="archive">
<div class="archive-item archive-year mark">
<h2><%- page.title %></h2>
<hr>
</div>
<div class="archive-item archive-post mark">
<% if (site.categories.length){ %>
<% site.categories.sort('path').each(function(category){ %>
<a class="<%= category.parent ? ' child' : ''%>" href="<%= url_for(category.path) %>">
<time><i class='fas fa-folder-open fa-fw' aria-hidden="true"></i>&nbsp;&nbsp;<%= category.name %></time>
<span class="title">
(<%- category.posts.length %>)
</span>
</a>
<% }) %>
<% } %>
</div>
<br>
<%- page.content %>
</section>
</article>
</div>
</section>
<% } %>
</div>
<%- partial('_partial/side') %>
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %>

@ -1,5 +1,6 @@
<div class="home-wrapper">
<% if (page.prev == 0) { %>
<% if (page.prev == 0) { %>
<div class="home-wrapper">
<div class='home-cover'>
<h1 class='title'><%- theme.home_cover.title %></h1>
<br>
@ -33,9 +34,11 @@
</ul>
</div>
</div>
<% } %>
<%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %>
</div>
<% } else { %>
<%- partial('_partial/header', null, {cache: !config.relative_link, path: path}) %>
</div>
<% } %>
<div class="l_body" id='posts'>
<div class='container clearfix'>
<div class='l_main'>

@ -1,6 +1,34 @@
<div class='l_main'>
<%- partial('_partial/archive') %>
<% if (site.posts && site.posts.length > 0) { %>
<section class="post-list">
<div class='post-wrapper'>
<article id="archive-page" class="post article white-box">
<section class="archive">
<div class="archive-item archive-year mark">
<h2><%- page.title %></h2>
<hr>
</div>
<div class="archive-item archive-post mark">
<% if (site.tags.length){ %>
<% site.tags.sort('path').each(function(tags){ %>
<% if (tags.posts.length){ %>
<a class="<%= tags.parent ? ' child' : ''%>" href="<%= url_for(tags.path) %>">
<time><i class='fas fa-hashtag fa-fw' aria-hidden="true"></i>&nbsp;&nbsp;<%= tags.name %></time>
<span class="title">
(<%- tags.posts.length %>)
</span>
</a>
<% } %>
<% }) %>
<% } %>
</div>
<br>
<%- page.content %>
</section>
</article>
</div>
</section>
<% } %>
</div>
<%- partial('_partial/side') %>
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %>

Loading…
Cancel
Save