支持某篇文章不显示readmore阅读全文按钮

i18n
xaoxuu 6 years ago
parent 11901ee8c3
commit c2be402005
  1. 32
      layout/_partial/article.ejs
  2. 2
      layout/_partial/post.ejs
  3. 31
      layout/links.ejs

@ -14,6 +14,7 @@
<% } 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) %>
@ -39,21 +40,22 @@
<div class="article-entry" itemprop="articleBody">
<%- post.content %>
</div>
<section class='meta' id="footer-meta">
<time class="time" itemprop="dateUpdated" datetime="<%- moment(post.updated).format() %>" content="<%- date(post.updated, config.date_format) %>">
<i class="fas fa-pen fa-fw" aria-hidden="true"></i>&nbsp;本文最后更新于:<%- date(post.updated, config.date_format) %>
</time>
<% if (post.tags && post.tags.length && post.tags.each) { %>
<%
var items = [];
post.tags.each(function(item){
items.push('<div class="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.join(' ') %>
<% } %>
</section>
<% if(post.layout == 'post'){ %>
<section class='meta' id="footer-meta">
<time class="time" itemprop="dateUpdated" datetime="<%- moment(post.updated).format() %>" content="<%- date(post.updated, config.date_format) %>">
<i class="fas fa-pen fa-fw" aria-hidden="true"></i>&nbsp;本文最后更新于:<%- date(post.updated, config.date_format) %>
</time>
<% if (post.tags && post.tags.length && post.tags.each) { %>
<%
var items = [];
post.tags.each(function(item){
items.push('<div class="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.join(' ') %>
<% } %>
</section>
<% } %>
<% if(post.prev || post.next){ %>
<div class="prev-next">

@ -25,7 +25,7 @@
<section class="article typo">
<%- post.excerpt || post.description || post.content %>
<% if (post.excerpt || post.description) { %>
<% if (post.readmore != false && (post.excerpt || post.description)) { %>
<div class="readmore">
<a href="<%- url_for(post.path) %>" class="flat-box">
<i class="fas fa-book-open fa-fw" aria-hidden="true"></i>

@ -0,0 +1,31 @@
<% 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>
<% }) %>
</section>
<%} %>
<% }) %>
<% } %>
<%- partial('_partial/article', {post: page, index: false}) %>
Loading…
Cancel
Save