hexo/themes/oranges/layout/post.ejs

170 lines
6.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 文章详情页展示文章具体内容url形式https://yoursite/文章标题/ -->
<!-- 同时为「标签tag」「朋友friend」「分类categories」「关于about」页面的承载页面具体展示取决于page.type -->
<% if (theme.mathjax && theme.mathjax.enable){ %>
<%- partial('_partial/mathjax') %>
<% } %>
<% if (theme.codeBlock && theme.codeBlock.copy && theme.codeBlock.copy.enable){ %>
<%- partial('_partial/clipboard') %>
<% } %>
<% if (page.type === "tags") { %>
<!-- 标签页 url形式https://yoursite/tags/ -->
<div class="container tag-index">
<div>
<%- list_tags({ class: "tag" }) %>
</div>
</div>
<% } %>
<% if (page.type === "categories") { %>
<!-- 分类页 url形式https://yoursite/categories/ -->
<div class="container category-index">
<div>
<%- list_categories({orderby: "length", order: -1}) %>
</div>
</div>
<% } %>
<% if (page.type === "friends") { %>
<!-- 朋友页 url形式https://yoursite/friends/ -->
<div class="container friend-index">
<div class="friend-list">
<% for(let friend of theme.friends) { %>
<div class="friend-list-item">
<span class="nickname">@ <%- friend.nickname %></span>
<a href="<%- friend.site %>" target="_blank">
<span class="site-path"><%- friend.site %></span>
</a>
<p class="card-meta">
<%- friend.meta %>
</p>
</div>
<% } %>
</div>
<div class="markdown-body">
<%- page.content %>
</div>
</div>
<% } %>
<% if(page.type === "about") { %>
<!-- 关于页 url形式https://yoursite/about/ -->
<div class="container about-index">
<div class="markdown-body">
<%- page.content %>
</div>
</div>
<% } %>
<% if (!page.type) { %>
<!-- 文章内容页 url形式https://yoursite/文章标题/ -->
<div class="container post-details" id="post-details">
<div class="post-content">
<div class="post-title"><%- page.title %></div>
<div class="post-attach">
<span class="post-pubtime">
<i class="iconfont icon-updatetime mr-10" title="<%= __('updateTime') %>"></i>
<%- page.updated.format("YYYY-MM-DD HH:mm:ss") %>
</span>
<% for(item of theme.navbar) {
if (item.key === 'tags' && item.enable) {
if(page.tags && page.tags.length > 0) { %>
<span class="post-tags">
<i class="iconfont icon-tags mr-10" title="<%= __('tags') %>"></i>
<% for(let item of page.tags.data) { %>
<span class="span--tag mr-8">
<a href="<%= url_for(item.path)%>" title="<%- item.name %>">
#<%- item.name %>
</a>
</span>
<% } %>
</span>
<% }
}
if (item.key === 'categories' && item.enable) {
if(page.tags && page.categories.length > 0) { %>
<span class="post-categories">
<i class="iconfont icon-bookmark" title="<%= __('categories') %>"></i>
<% for(let item of page.categories.data){ %>
<span class="span--category">
<a href="<%= url_for(item.path)%>" title="<%- item.name %>">
<b>#</b> <%- item.name %>
</a>
</span>
<% } %>
</span>
<% }
}
} %>
</div>
<div class="markdown-body">
<%- page.content %>
</div>
<% if(theme.prevnext.enable) { %>
<div class="prev-or-next">
<div class="post-foot-next">
<% if(page.next) { %>
<a href="<%- url_for(page.next.path) %>" target="_self">
<i class="iconfont icon-chevronleft"></i>
<span><%= __('prev') %></span>
</a>
<% } %>
</div>
<div class="post-attach">
<span class="post-pubtime">
<i class="iconfont icon-updatetime mr-10" title="<%= __('updateTime') %>"></i>
<%- page.updated.format("YYYY-MM-DD HH:mm:ss") %>
</span>
<% for(item of theme.navbar) {
if (item.key === 'tags' && item.enable) {
if(page.tags && page.tags.length > 0) { %>
<span class="post-tags">
<i class="iconfont icon-tags mr-10" title="<%= __('tags') %>"></i>
<% for(let item of page.tags.data) { %>
<span class="span--tag mr-8">
<a href="<%= url_for(item.path)%>" title="<%- item.name %>">
#<%- item.name %>
</a>
</span>
<% } %>
</span>
<% }
}
if (item.key === 'categories' && item.enable) {
if(page.tags && page.categories.length > 0) { %>
<span class="post-categories">
<i class="iconfont icon-bookmark" title="<%= __('categories') %>"></i>
<% for(let item of page.categories.data){ %>
<span class="span--category">
<a href="<%= url_for(item.path)%>" title="<%- item.name %>">
<b>#</b> <%- item.name %>
</a>
</span>
<% } %>
</span>
<% }
}
} %>
</div>
<div class="post-foot-prev">
<% if(page.prev) { %>
<a href="<%- url_for(page.prev.path) %>" target="_self">
<span><%= __('next') %></span>
<i class="iconfont icon-chevronright"></i>
</a>
<% } %>
</div>
</div>
<% } %>
</div>
<%- partial("_partial/catalog") %>
<% if(theme.comments.enable) { %>
<div class="comments-container">
<%- partial("_partial/comments") %>
</div>
<% } %>
</div>
<% } %>