57 lines
2.5 KiB
Plaintext
57 lines
2.5 KiB
Plaintext
<!-- 文章 -->
|
|
<article class="post">
|
|
<header>
|
|
<!-- 标签这有且只能显示一个 -->
|
|
<% if (post.categories && post.categories.length) { %>
|
|
<%-
|
|
list_categories(post.categories, {
|
|
show_count: false,
|
|
class: 'cat',
|
|
style: 'none',
|
|
separator: '|'
|
|
}).split('|')[0]
|
|
%>
|
|
<% } else { %>
|
|
<a href="javascript: void(0);" class="cat">未分类</a>
|
|
<% } %>
|
|
<!-- 文章标题 -->
|
|
<%- partial('post/title', { class_name: 'post-title' }) %>
|
|
</header>
|
|
<p class="post-meta">
|
|
<%- post.author || '柠烟夏季' %> 发表于
|
|
<%- partial('post/date', { date_format: 'YYYY-MM-DD' }) %>
|
|
|
|
<span class="post-tags">
|
|
标签:
|
|
<%- partial('post/tag') %>
|
|
</span>
|
|
</p>
|
|
|
|
<div class="post-content">
|
|
<div class="post-excerpt">
|
|
<% if (index == true) { %>
|
|
<%- post.blogexcerpt || post.excerpt || post.content %>
|
|
<% } %>
|
|
<p class="more">
|
|
<a href="<%- url_for(post.permalink) %>">阅读全文</a>
|
|
</p>
|
|
</div>
|
|
<div class="post-thumbnail" data-img="<%- post.photos[0] %>">
|
|
<a href="<%= post.permalink %>" title="<%= post.title %>">
|
|
<% if (post.thumbnail) { %>
|
|
<!--
|
|
<%- image_tag(post.thumbnail, { class: "thumbnail" }) %>
|
|
-->
|
|
<img class="thumbnail" src="<%- url_for('img/loading2.gif') %>" data-echo="<%= post.thumbnail %>" alt="<%= post.title %>" >
|
|
<% } else if (post.photos.length) { %>
|
|
<img class="thumbnail" src="<%- url_for('img/loading2.gif') %>" data-echo="<%= url_for(post.photos[0]) %>" alt="<%= post.title %>" >
|
|
<% } else if (theme.CDN) { %>
|
|
<img class="thumbnail" src="<%- url_for('img/loading2.gif') %>" data-echo="<%- url_for(theme.CDN + 'thumbnail/' + date(post.date, 'YYYY-MM-DD').charAt(date(post.date, 'YYYY-MM-DD').length - 1) + '.jpg') %>" alt="默认配图" >
|
|
<% } else { %>
|
|
<img class="thumbnail" src="<%- url_for('img/loading2.gif') %>" data-echo="<%- url_for('img/thumbnail/' + date(post.date, 'YYYY-MM-DD').charAt(date(post.date, 'YYYY-MM-DD').length - 1) + '.jpg') %>" alt="默认配图" >
|
|
<% } %>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</article>
|