halo-theme-xinac-fantastic/layout/common/article.ftl

198 lines
9.8 KiB
Plaintext
Raw Normal View History

2019-10-02 16:15:37 +00:00
<#macro article post,layout,commentType,index>
<#include "../comment/comment.ftl">
<#-- <div class="card" <#if is_post??><#else>style="margin-left: 10px;"</#if>>-->
2019-10-18 15:45:00 +00:00
<div class="card" <#if is_post??>style="display: block"</#if> >
2019-10-02 16:15:37 +00:00
<#if is_post?? || is_page?? || is_sheet??>
<#else >
2020-03-27 10:31:36 +00:00
<#if post.thumbnail?? && post.thumbnail!='' && (settings.post_thumbnail_enable?? && settings.post_thumbnail_enable)>
2020-04-07 03:57:49 +00:00
<div class="card-image is-hidden-mobile">
2019-10-02 16:15:37 +00:00
<#if index>
2020-03-27 10:31:36 +00:00
<a href="${post.fullPath!}">
2019-10-02 16:15:37 +00:00
<img class="thumbnail" src="${post.thumbnail!}" alt="${post.title!}">
</a>
<#else>
<span class="image is-7by1">
<img class="thumbnail" src="${post.thumbnail!}" alt="${post.title!}">
</span>
2019-10-02 16:15:37 +00:00
</#if>
</div>
</#if>
</#if>
2019-12-08 02:37:56 +00:00
<div class="card-content article " id="card-content" style="width: 100%">
2019-10-02 16:15:37 +00:00
<div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
<div class="level-left">
<time class="level-item has-text-grey"
datetime="${post.createTime!}">${post.createTime?string["yyyy-MM-dd EE"]}</time>
2019-10-02 16:15:37 +00:00
<#if index>
<#if post.categories?? && post.categories?size gt 0>
2020-04-07 03:57:49 +00:00
<div class="level-item is-hidden-mobile">
2019-10-02 16:15:37 +00:00
<#list post.categories as category>
<a class="has-link-grey -link"
2020-04-02 09:58:19 +00:00
href="${category.fullPath!}">${category.name!}&emsp;</a>&nbsp;
2019-10-02 16:15:37 +00:00
</#list>
</div>
</#if>
<#else>
<#if categories?? && categories?size gt 0>
2020-04-07 03:57:49 +00:00
<div class="level-item is-hidden-mobile">
2019-10-02 16:15:37 +00:00
<#list categories as category>
<a class="has-link-grey -link"
2020-04-02 09:58:19 +00:00
href="${category.fullPath!}">${category.name!}&emsp;</a>&nbsp;
2019-10-02 16:15:37 +00:00
</#list>
</div>
</#if>
</#if>
</div>
<div class="level-right">
<div class="level-item">
<span class="level-item has-text-grey">评论(${post.commentCount!'0'})</span>
<span class="level-item has-text-grey">浏览(${post.visits!'0'})</span>
</div>
</div>
2019-10-02 16:15:37 +00:00
</div>
<#if is_post??>
<h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
<#if index>
2020-03-27 10:31:36 +00:00
<a class="has-link-black-ter" href="${post.fullPath!}">${post.title!}</a>
2019-10-02 16:15:37 +00:00
<#else>
${post.title!}
</#if>
</h1>
<#else>
2019-10-06 16:01:33 +00:00
<h1 class="title is-size-5 is-size-5-mobile has-text-weight-normal">
2019-10-02 16:15:37 +00:00
<#if index>
2020-03-27 10:31:36 +00:00
<a class="has-link-black-ter" href="${post.fullPath!}">${post.title!}</a>
2019-10-02 16:15:37 +00:00
<#else>
${post.title!}
</#if>
</h1>
</#if>
2019-12-08 02:37:56 +00:00
<div id="<#if is_post??>post-article<#else>is-hidden-touch</#if>" class="content <#if is_post?? || is_sheet??>post-article<#else>is-hidden-touch</#if>">
2019-10-02 16:15:37 +00:00
<#if index && post.summary?? && post.summary!=''>
${post.summary!}
<#else>
${post.formatContent!}
</#if>
</div>
<#if !index>
<div class="level is-size-7 is-uppercase is-mobile">
2019-10-02 16:15:37 +00:00
<div class="level-start">
<#if tags?? && (tags?size gt 0)>
<div class="level-item">
<span class="is-size-6 has-text-grey has-mr-7">#</span>
<#list tags as tag>
2020-03-27 10:31:36 +00:00
<a class="has-link-grey -link" style="margin-left: 10px;" href="${tag.fullPath!}">${tag.name!}</a>&nbsp;
</#list>
</div>
</#if>
</div>
<div class="level-end">
2019-10-02 16:15:37 +00:00
<div class="level-item">
<span class="has-text-grey">最后编辑时间:${post.editTime!?string('yyyy-MM-dd HH:mm:ss')}</span>
2019-10-02 16:15:37 +00:00
</div>
</div>
</div>
</#if>
<#if index>
2019-10-02 16:15:37 +00:00
<div class="level is-mobile">
<div class="level-start">
<#if post.tags?? && (post.tags?size gt 0)>
<div class="level-item">
<span class="is-size-6 has-text-grey has-mr-7">#</span>
<#list post.tags as tag>
2020-03-27 10:31:36 +00:00
<a class="has-link-grey -link" style="margin-left: 10px;" href="${tag.fullPath!}">${tag.name!}</a>&nbsp;
</#list>
</div>
</#if>
2019-10-02 16:15:37 +00:00
</div>
<#if post.summary?? && post.summary!=''>
<div class="level-end">
<div class="level-item">
2020-03-27 10:31:36 +00:00
<a class="button is-size-7 is-light" target="_blank" href="${post.fullPath!}#more">阅读更多</a>
</div>
</div>
</#if>
2019-10-02 16:15:37 +00:00
</div>
</#if>
</div>
</div>
<#if !index && !is_sheet??>
<div class="card" style="font-size: 20px; line-height: 1.5em; padding: 5px; color: black; background-color: rgba(255, 255, 255, 0.7); border-left: 3px solid skyblue;">
<div class="card-content">
<p style="font-size: 15px;">
本文由 <a target="_blank" href="${context!}">${user.nickname!}</a> 创作,如果您觉得本文不错,请随意赞赏<br>
采用 <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/" rel="external nofollow">知识共享署名4.0</a> 国际许可协议进行许可<br>
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名<br>
2020-03-27 10:31:36 +00:00
原文链接:<a target="_blank" href="${post.fullPath!}">${post.fullPath!}</a><br>
最后更新:${post.editTime?string('yyyy-MM-dd HH:mm:ss')}
</p>
2019-10-02 16:15:37 +00:00
</div>
</div>
2019-10-02 16:15:37 +00:00
</#if>
<#if !index>
<#if (settings.donate_alipay?? && settings.donate_alipay!='') || (settings.donate_wechat?? && settings.donate_wechat!='')>
<div class="card">
<div class="card-content">
<h3 class="menu-label has-text-centered">喜欢这篇文章?打赏一下作者吧</h3>
<div class="buttons is-centered">
<#if settings.donate_alipay?? && settings.donate_alipay!=''>
<#include "../donate/alipay.ftl">
</#if>
<#if settings.donate_wechat?? && settings.donate_wechat!=''>
<#include "../donate/wechat.ftl">
</#if>
</div>
</div>
</div>
</#if>
</#if>
2019-10-02 16:15:37 +00:00
2020-03-27 10:31:36 +00:00
<#if !index && (nextPost?? || prevPost??)>
2019-10-02 16:15:37 +00:00
<div class="card card-transparent">
<div class="level post-navigation is-flex-wrap is-mobile">
2020-03-27 05:20:30 +00:00
<div class="level-start">
2020-03-27 10:31:36 +00:00
<#if prevPost??>
<a class="level level-item has-link-grey article-nav-prev" href="${prevPost.fullPath!}">
2019-10-02 16:15:37 +00:00
<i class="level-item fas fa-chevron-left"></i>
2020-03-27 10:31:36 +00:00
<span class="level-item">${prevPost.title!}</span>
2019-10-02 16:15:37 +00:00
</a>
2020-03-27 05:20:30 +00:00
<#else>
<a class="level level-item has-link-grey article-nav-prev" href="${context!}/">
<i class="level-item fas fa-chevron-left"></i>
<span class="level-item">没有了</span>
</a>
</#if>
</div>
<div class="level-end">
<#if nextPost??>
2020-03-27 10:31:36 +00:00
<a class="level level-item has-link-grey article-nav-next" href="${nextPost.fullPath!}">
2019-10-02 16:15:37 +00:00
<span class="level-item">${nextPost.title!}</span>
<i class="level-item fas fa-chevron-right"></i>
</a>
2020-03-27 05:20:30 +00:00
<#else>
<a class="level level-item has-link-grey article-nav-next" href="${context!}/">
<span class="level-item">没有了</span>
<i class="level-item fas fa-chevron-right"></i>
</a>
</#if>
</div>
2019-10-02 16:15:37 +00:00
</div>
</div>
</#if>
2020-03-27 10:31:36 +00:00
<#if !index && settings.comment_enable?? && settings.comment_enable>
2019-10-02 16:15:37 +00:00
<div class="card" id="comment-wrapper">
<div class="card-content">
<h3 class="title is-5 has-text-weight-normal">评论</h3>
<#if commentType == 'post'>
<@comment post,"post" />
<#else>
<@comment post,"sheet" />
</#if>
</div>
</div>
</#if>
</#macro>