<div
  class="z-slide"
  th:fragment="hot-post"
  th:if="${theme.config.post.hot_post != null and T(java.lang.Integer).parseInt(theme.config.post.hot_post.post_number) > 0}"
>
  <div
    th:replace="~{modules/home-widgets/slide-widget-base::header(${theme.config.post.hot_post.title ?: '热门文章'})}"
  ></div>

  <div class="z-slide-body">
    <div class="slide-list" id="hot-post-scroll-container">
      <th:block
        th:with="postNumber = ${T(java.lang.Integer).parseInt(theme.config.post.hot_post.post_number)},
                 posts = ${postFinder.list({
                   page: 1,
                   size: postNumber,
                   sort: {'stats.visit,desc', 'metadata.creationTimestamp,asc'}
                 })}"
      >
        <th:block th:each="post : ${posts.items}">
          <div th:replace="~{modules/home-widgets/slide-widget-base::post-item(${post})}"></div>
        </th:block>
      </th:block>
    </div>

    <div th:replace="~{modules/home-widgets/slide-widget-base::footer('hot-post-scroll-container')}"></div>
  </div>

  <div th:replace="~{modules/home-widgets/slide-widget-base::script('hot-post-scroll-container')}"></div>
</div>
