<div
  class="z-slide"
  th:fragment="random-post"
  th:if="${site.version != null and site.version.compareTo('2.24.1') >= 0 and theme.config.post.random_post != null and T(java.lang.Integer).parseInt(theme.config.post.random_post.post_number) > 0}"
>
  <div
    th:replace="~{modules/home-widgets/slide-widget-base::header(${theme.config.post.random_post.title ?: '随机文章'})}"
  ></div>

  <div class="z-slide-body">
    <div class="slide-list" id="random-post-scroll-container">
      <th:block
        th:with="postNumber = ${T(java.lang.Integer).parseInt(theme.config.post.random_post.post_number)},
                 posts = ${postFinder.random(postNumber)}"
      >
        <th:block th:each="post : ${posts}">
          <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('random-post-scroll-container')}"></div>
  </div>

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