i18n
xaoxuu 6 years ago
parent c9b7c5f2af
commit 46727537aa
  1. 87
      layout/_partial/article.ejs
  2. 47
      layout/_partial/comments.ejs
  3. 60
      layout/_partial/meta.ejs
  4. 25
      layout/_partial/post.ejs
  5. 0
      layout/_partial/recommended_posts.ejs
  6. 2
      layout/index.ejs
  7. 62
      layout/links.ejs

@ -1,40 +1,5 @@
<article id="<%= post.layout %>-<%= post.slug %>" class="post white-box article-type-<%= post.layout %>" itemscope itemprop="blogPost">
<section class='meta'>
<% if(post.music){ %>
<div class="aplayer" data-mini=true
data-mode="circulation" data-volume="0.5"
data-server="<%= post.music.server %>"
data-type="<%= post.music.type %>"
data-id="<%= post.music.id %>">
</div>
<% } %>
<div class="meta" id="header-meta">
<% if(post.title){ %>
<h1 class="title"><%= post.title %></h1>
<% } else if (post.date) { %>
<h1 class="title"><%= date(post.date, config.date_format) %></h1>
<% } %>
<time class="time">
<i class="fas fa-calendar-alt fa-fw" aria-hidden="true"></i>
<%= date(post.date, config.date_format) %>
</time>
<% if (config.leancloud && config.leancloud.app_id && config.leancloud.app_key) { %>
<div class="browse leancloud"><i class="fas fa-eye fa-fw" aria-hidden="true"></i>
<span id="<%= url_for(post.path) %>" class="leancloud_visitors" data-flag-title="<%= post.title %>">
<span class="leancloud-visitors-count"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span>
</span>
</div>
<% } else { %>
<div class="browse busuanzi"><i class="fas fa-eye fa-fw" aria-hidden="true"></i>
<span id="busuanzi_value_page_pv"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span>
</div>
<% } %>
<%- partial('categories',{post:post}) %>
</div>
</section>
<article id="<%= post.layout %>" class="post white-box article-type-<%= post.layout %>" itemscope itemprop="blogPost">
<%- partial('meta',{post:post}) %>
<section class="article typo">
<div class="article-entry" itemprop="articleBody">
@ -127,53 +92,7 @@
<br>
<!-- 显示推荐文章和评论 -->
<% if (post && ((theme.recommended_posts && theme.recommended_posts.autoDisplay == false && post.recommended_posts != false) || (post.comments && (config.disqus_shortname || config.livere_shortname || config.valine)) )) { %>
<article class="post white-box comments">
<section class="article typo">
<% if (theme.recommended_posts && theme.recommended_posts.autoDisplay == false && post.recommended_posts != false) { %>
<%- partial('post/recommended_posts', {page: post, site: site}) %>
<% } %>
<% if (post.comments) { %>
<h4><i class="fas fa-comments fa-fw" aria-hidden="true"></i>&nbsp;评论</h4>
<% if (config.disqus_shortname) { %>
<section id="comments">
<div id="disqus_thread">
无法加载评论系统,请确保您的网络能够正常访问 <a href="https://disqus.com">Disqus</a> 。
</div>
</section>
<% } %>
<% if (config.livere_uid){ %>
<section id="comments">
<div id="lv-container" data-id="city" data-uid="<%= config.livere_uid %>">
<noscript>为正常使用来必力评论功能请激活JavaScript</noscript>
</div>
</section>
<% } %>
<% if (config.valine){ %>
<% if (config.valine.enable && config.valine.app_id && config.valine.app_key){ %>
<div class="subtitle">
<h6><b>文明评论,请勿灌水。</b>为了便于区分和接收回复提醒,请您在留言时填写一下<b>昵称</b>和<b>邮箱</b>。</h6>
<div>
<section id="comments">
<div id="valine_container" class="valine_thread">
<i class="fas fa-spinner fa-spin fa-fw"></i>
</div>
</section>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="//unpkg.com/valine/dist/Valine.min.js"></script>
<% } %>
<% } %>
<% } %>
</section>
</article>
<% } %>
<%- partial('comments') %>
<script>
window.subData = {

@ -0,0 +1,47 @@
<!-- 显示推荐文章和评论 -->
<% if (page && ((theme.recommended_posts && theme.recommended_posts.autoDisplay == false && page.recommended_posts != false) || (page.comments && (config.disqus_shortname || config.livere_shortname || config.valine)) )) { %>
<article class="post white-box comments">
<section class="article typo">
<% if (theme.recommended_posts && theme.recommended_posts.autoDisplay == false && page.recommended_posts != false) { %>
<%- partial('recommended_posts', {page: page, site: site}) %>
<% } %>
<% if (page.comments) { %>
<h4><i class="fas fa-comments fa-fw" aria-hidden="true"></i>&nbsp;评论</h4>
<% if (config.disqus_shortname) { %>
<section id="comments">
<div id="disqus_thread">
无法加载评论系统,请确保您的网络能够正常访问 <a href="https://disqus.com">Disqus</a> 。
</div>
</section>
<% } %>
<% if (config.livere_uid){ %>
<section id="comments">
<div id="lv-container" data-id="city" data-uid="<%= config.livere_uid %>">
<noscript>为正常使用来必力评论功能请激活JavaScript</noscript>
</div>
</section>
<% } %>
<% if (config.valine){ %>
<% if (config.valine.enable && config.valine.app_id && config.valine.app_key){ %>
<div class="subtitle">
<h6><b>文明评论,请勿灌水。</b>为了便于区分和接收回复提醒,请您在留言时填写一下<b>昵称</b>和<b>邮箱</b>。</h6>
<div>
<section id="comments">
<div id="valine_container" class="valine_thread">
<i class="fas fa-spinner fa-spin fa-fw"></i>
</div>
</section>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="//unpkg.com/valine/dist/Valine.min.js"></script>
<% } %>
<% } %>
<% } %>
</section>
</article>
<% } %>

@ -0,0 +1,60 @@
<% if(is_home() || is_category() || is_archive() || is_tag()) {
var isPostList = true;
} else {
var isPostList = false;
} %>
<section class='meta'>
<% if((!isPostList && post.music) || (isPostList && post.music && post.music.enable == true)){ %>
<div class="aplayer" data-mini=true
data-mode="circulation" data-volume="0.7"
data-server="<%= post.music.server %>"
data-type="<%= post.music.type %>"
data-id="<%= post.music.id %>">
</div>
<% } %>
<div class="meta" id="header-meta">
<% if(isPostList){ %>
<h2 class="title">
<a href="<%- url_for(post.path) %>">
<% if(post.title){ %>
<%= post.title %>
<% } else if (post.date) { %>
<%= date(post.date, config.date_format) %>
<% } %>
</a>
</h2>
<% } else { %>
<% if(post.title){ %>
<h1 class="title"><%= post.title %></h1>
<% } else if (post.date) { %>
<h1 class="title"><%= date(post.date, config.date_format) %></h1>
<% } %>
<% } %>
<% if(post.date){ %>
<time class="time">
<i class="fas fa-calendar-alt fa-fw" aria-hidden="true"></i>
<%= date(post.date, config.date_format) %>
</time>
<% } %>
<% if(post.categories){ %>
<%- partial('categories',{post:post}) %>
<% } %>
<% if(!isPostList){ %>
<% if (post.visitors_count != false && config.leancloud && config.leancloud.app_id && config.leancloud.app_key) { %>
<div class="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 %>">
<span class="leancloud-visitors-count"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span>
</span>
</div>
<% } else { %>
<div class="browse busuanzi"><i class="fas fa-eye fa-fw" aria-hidden="true"></i>
<span id="busuanzi_value_page_pv"><i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span>
</div>
<% } %>
<% } %>
</div>
</section>

@ -1,28 +1,5 @@
<article class="post reveal <%= (post.title) ? "" : "no-title" %>">
<section class="meta">
<% if(post.music && !post.music.internal){ %>
<div class="aplayer" data-mini=true
data-mode="circulation" data-volume="0.5"
data-server="<%= post.music.server %>"
data-type="<%= post.music.type %>"
data-id="<%= post.music.id %>">
</div>
<% } %>
<h2 class="title">
<a href="<%- url_for(post.path) %>">
<% if(post.title){ %>
<%= post.title %>
<% } else if (post.date) { %>
<%= date(post.date, config.date_format) %>
<% } %>
</a>
</h2>
<time class="time">
<i class="fas fa-calendar-alt fa-fw" aria-hidden="true"></i>&nbsp;<%= date(post.date, config.date_format) %>
</time>
<%- partial('categories',{post:post}) %>
</section>
<%- partial('meta',{post:post}) %>
<section class="article typo">
<%- post.excerpt || post.description || post.content %>
<% if (post.readmore != false && (post.excerpt || post.description)) { %>

@ -1 +1 @@
<%- partial('_partial/archive') %>
<%- partial('_partial/archive') %>

@ -1,31 +1,35 @@
<% if (page.links){ %>
<% (page.links||[]).forEach(function(group){ %>
<% if(group.items) { %>
<section class='m_widgets' id='mywidgset'>
<% if(group.type) { %>
<% if (group.icon) { %>
<i class="<%= group.icon %> fa-fw" aria-hidden="true"></i><h2 class='header'><%= group.type %></h2>
<%} else {%>
<h2 class='header'><%= group.type %></h2>
<%} %>
<%} %>
<% (group.items||[]).forEach(function(item){ %>
<div class='friend-wrapper'>
<div class='friend-left'>
<img class='avatar' src='<%= url_for(item.avatar ? item.avatar : "https://img.vim-cn.com/a4/87a96e2e01b1180bba1e76e190df5220378c1a.png") %>'/>
</div>
<div class='friend-right'>
<h3><%= item.name %></h3>
<p><%= item.desc %></p>
<div class='friend-tags-wrapper'>
<% (item.tags||[]).forEach(function(tag){ %>
<a class="tags"><%= tag %></a>
<article id="<%= page.layout %>" class="post white-box article-type-<%= page.layout %>" itemscope itemprop="blogPost">
<%- partial('_partial/meta',{post:page}) %>
<section class="article typo">
<% if (page.links){ %>
<% (page.links||[]).forEach(function(group){ %>
<% if(group.items) { %>
<section class='m_widgets' id='mywidgset'>
<% if(group.type) { %>
<% if (group.icon) { %>
<i class="<%= group.icon %> fa-fw" aria-hidden="true"></i><h2 class='header'><%= group.type %></h2>
<%} else {%>
<h2 class='header'><%= group.type %></h2>
<%} %>
<%} %>
<% (group.items||[]).forEach(function(item){ %>
<div class='friend-wrapper'>
<div class='friend-left'>
<img class='avatar' src='<%= url_for(item.avatar ? item.avatar : "https://img.vim-cn.com/a4/87a96e2e01b1180bba1e76e190df5220378c1a.png") %>'/>
</div>
<div class='friend-right'>
<h3><%= item.name %></h3>
<p><%= item.desc %></p>
<div class='friend-tags-wrapper'>
<% (item.tags||[]).forEach(function(tag){ %>
<a class="tags"><%= tag %></a>
<% }) %>
</div>
</div>
<% }) %>
</div>
</div>
</section>
<%} %>
<% }) %>
</section>
<%} %>
<% }) %>
<% } %>
<%- partial('_partial/article', {post: page, index: false}) %>
<% } %>
</section>
</article>

Loading…
Cancel
Save