97 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			97 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <th:block xmlns:th="https://www.thymeleaf.org"
 | |
|      th:fragment="article (post, type)"
 | |
|      th:with="updateInterval = ${T(java.lang.Math).floor((#dates.createNow().getTime()/1000.0 - post.status.lastModifyTime.getEpochSecond())/86400.0).intValue()}">
 | |
| 
 | |
|     <div th:if="${!#strings.isEmpty(post.spec.cover)}" class="card widget">
 | |
|         <div class="cover-image" th:style="'background-image: url(' + ${post.spec.cover} + ')'">
 | |
|             <div th:if="${type == 'Post' && !#lists.isEmpty(post.categories)}" class="category">
 | |
|                 <a th:each="cy : ${post.categories}" th:href="${cy.status.permalink}"
 | |
|                    th:text="${cy.spec.displayName}"></a> 
 | |
|             </div>
 | |
|             <div class="details">
 | |
|                 <h1 class="title" th:text="${post.spec.title}"></h1>
 | |
|                 <ul class="breadcrumb">
 | |
|                     <li th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd HH:mm')}"></li>
 | |
|                     <li><i class="fa fa-eye"></i>[[${post.stats.visit}]]</li>
 | |
|                     <li th:if="${post.spec.allowComment}" class="is-hidden-mobile"><i class="fa fa-comments-o"></i>[[${post.stats.comment}]]
 | |
|                     </li>
 | |
|                     <li><i class="fa fa-thumbs-o-up"></i>[[${post.stats.upvote}]]</li>
 | |
|                     <li><i class="fa fa-pencil"></i>[[${#strings.length(#strings.trim(post.content.content))}]]</li>
 | |
|                 </ul>
 | |
|             </div>
 | |
|         </div>
 | |
|     </div>
 | |
| 
 | |
|     <div th:if="${!#strings.isEmpty(theme.config.post.invalid_tips_day) && updateInterval > T(java.lang.Long).parseLong(theme.config.post.invalid_tips_day)}"
 | |
|          class="card tips brightness"><i class="fa fa-times click-close" data-close=".tips"></i>本文最后更新于
 | |
|         [[${#dates.format(post.status.lastModifyTime,'yyyy-MM-dd')}]],距今已有 [[${updateInterval}]]
 | |
|         天,若文章内容或图片链接失效,请留言反馈。
 | |
|     </div>
 | |
| 
 | |
|     <div th:if="${post.metadata.annotations.containsKey('tips')}" class="card tips brightness"><i
 | |
|             class="fa fa-times click-close" data-close=".tips"></i>[[${post.metadata.annotations.tips}]]
 | |
|     </div>
 | |
| 
 | |
|     <div class="card">
 | |
|         <div class="card-content main">
 | |
|             <th:block th:if="${!#strings.isEmpty(post.spec.cover)}">
 | |
|                 <h1 class="title" th:text="${post.spec.title}"></h1>
 | |
|                 <div class="meta">
 | |
|                     <ul class="breadcrumb">
 | |
|                         <li th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd HH:mm')}"></li>
 | |
|                         <li><i class="fa fa-eye"></i>[[${post.stats.visit}]]</li>
 | |
|                         <li th:if="${post.spec.allowComment}" class="is-hidden-mobile"><i class="fa fa-comments-o"></i>[[${post.stats.comment}]]
 | |
|                         </li>
 | |
|                         <li><i class="fa fa-thumbs-o-up"></i>[[${post.stats.upvote}]]</li>
 | |
|                         <li><i class="fa fa-pencil"></i>[[${#strings.length(#strings.trim(post.content.content))}]]</li>
 | |
|                     </ul>
 | |
|                     <div th:if="${type == 'Post' && !#lists.isEmpty(post.categories)}" class="level-item">
 | |
|                         <a th:each="cy : ${post.categories}" th:href="${cy.status.permalink}"
 | |
|                            th:text="${cy.spec.displayName}"></a> 
 | |
|                     </div>
 | |
|                 </div>
 | |
|                 <hr/>
 | |
|             </th:block>
 | |
| 
 | |
|             <div th:data-id="${post.metadata.name}" th:data-target="${type}" class="main-content article"
 | |
|                  th:utext="${post.content.content}">
 | |
|             </div>
 | |
| 
 | |
|             <th:block th:replace="~{main/admire}"/>
 | |
| 
 | |
|             <div th:if="${type == 'Post' && !#lists.isEmpty(post.tags)}" class="article-operation">
 | |
|                 <div class="level-item">
 | |
|                     <a th:each=" tag : ${post.tags}" th:href="${tag.status.permalink}"
 | |
|                        th:text="${tag.spec.displayName}"></a> 
 | |
|                 </div>
 | |
|             </div>
 | |
|             <th:bolck th:if="${enableCopyright || enableShare}">
 | |
|                 <hr/>
 | |
|                 <th:block th:if="${enableCopyright}">
 | |
|                     <th:block th:replace="~{main/copyright}"></th:block>
 | |
|                 </th:block>
 | |
|                 <div th:if="${enableShare}" class="dshare"></div>
 | |
|             </th:bolck>
 | |
|         </div>
 | |
|     </div>
 | |
| 
 | |
|     <th:block th:if="${type == 'Post'}" th:with="postCursor = ${postFinder.cursor(post.metadata.name)}">
 | |
|         <div th:if="${postCursor.hasPrevious() || postCursor.hasNext()}" class="card">
 | |
|             <div class="level post-navigation card-content">
 | |
|                 <a th:if="${postCursor.hasPrevious()}" class="level-item"
 | |
|                    th:href="@{${postCursor.previous.status.permalink}}">
 | |
|                     <i class="fa fa-angle-left"></i><span th:text="${postCursor.previous.spec.title}"></span>
 | |
|                 </a>
 | |
|                 <a th:if="${postCursor.hasNext()}" class="level-item" th:href="@{${postCursor.next.status.permalink}}">
 | |
|                     <span th:text="${postCursor.next.spec.title}"></span><i class="fa fa-angle-right"></i>
 | |
|                 </a>
 | |
|             </div>
 | |
|         </div>
 | |
|     </th:block>
 | |
| 
 | |
|     <div class="card card-content" id="comment-wrapper" th:if="${pluginFinder.available('PluginCommentWidget')}">
 | |
|         <h3 class="comment-title">评论</h3>
 | |
|         <halo:comment colorScheme="window.dataTheme" group="content.halo.run" th:kind="${type}"
 | |
|                       th:attr="name=${post.metadata.name}"/>
 | |
|     </div>
 | |
| </th:block> |