<!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" th:with="
      page = ${#lists.isEmpty(param.page) or #strings.isEmpty(param.page[0]) ? 1 : param.page[0]},
      tag = ${#lists.isEmpty(param.tag) ? null : param.tag[0]}
    ">

      <th:block th:if="${#strings.isEmpty(tag)}">
        <th:block th:replace="~{macro/home-blog :: home-blog(${postFinder.list(page,site.post.postPageSize)},'/archives',null,null)}"></th:block>
      </th:block>

      <th:block th:unless="${#strings.isEmpty(tag)}" th:each="categoryItem : ${categoryFinder.listAll()}">
        <th:block th:if="${#strings.equals(tag, categoryItem.spec.displayName) or #strings.equals(tag, categoryItem.metadata.name)}">
          <th:block th:replace="~{macro/home-blog :: home-blog(${postFinder.listByCategory(page,site.post.postPageSize,categoryItem.metadata.name)},'/archives',${categoryItem.spec.displayName},${categoryItem.metadata.name})}"></th:block>
        </th:block>
      </th:block>

    </div>

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

  </div>
</th:block>

</html>
