<!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org"
  th:replace="~{modules/layouts/layout :: layout(_head = null,_content = ~{::content},_title = ${'分类' + ' - ' + site.title})}">

<th:block th:fragment="content">

  <div class="page_main uk-width-2-3@m">

    <th:block th:replace="~{modules/header}"/>

    <div id="pjax-container">

      <div class="column_page page_wrap" uk-height-viewport="offset-top: true">
        <div class="page_inner uk-grid-small uk-child-width-1-2@m" uk-grid>
          <div class="column_item" th:each="categoryItem : ${categoryFinder.listAll()}">
            <div class="column_inner round12">
              <div class="cat_img">
                <a  th:href="@{${categoryItem.status.permalink}}"
                    th:with="cover_img=${#strings.contains(theme.config.post.category_banner,'http') ? ((#strings.contains(theme.config.post.category_banner,'?') ? theme.config.post.category_banner : theme.config.post.category_banner+'?')+','+categoryItem.metadata.name): theme.config.post.category_banner}">
                  <img th:src="${#strings.isEmpty(categoryItem.spec.cover) ? cover_img : thumbnail.gen(categoryItem.spec.cover, 's')}">
                  <div class="meta">
                    <div class="title">[[${categoryItem.spec.displayName}]]</div>
                    <p><span>[[${categoryItem.status.visiblePostCount}]]POSTS</span></p>
                  </div>
                </a>
              </div>
              <th:block th:with="posts = ${postFinder.listByCategory(1,2,categoryItem.metadata.name)}">
                <ul class="column_lists" th:if="${not #lists.isEmpty(posts.items)}">
                  <li th:each="post : ${posts.items}">
                    <a th:href="@{${post.status.permalink}}"><i
                            class="iconfont icon-huati"></i>[[${post.spec.title}]]</a>
                    <span>[[${#dates.format(post.spec.publishTime,'yyyy/MM/dd')}]]</span>
                  </li>
                </ul>
              </th:block>
            </div>
          </div>
        </div>
      </div>

    </div>

    <th:block th:replace="~{modules/footer-main}"/>

  </div>
</th:block>

</html>