<!doctype html>
<html
  xmlns:th="https://www.thymeleaf.org"
  th:replace="~{layout :: html(head = ~{::head}, content = ~{::content})}"
>
  <th:block th:fragment="head">
    <title th:text="|${post.spec.title} - ${site.title}|"></title>
  </th:block>
  <th:block th:fragment="content">
    <article>
      <h1 th:text="${post.spec.title}"></h1>
      <time th:text="${#temporals.format(post.spec.publishTime, 'yyyy-MM-dd')}"></time>
      <div th:utext="${post.content.content}"></div>
      <div th:if="${not #lists.isEmpty(post.tags)}">
        <a
          th:each="tag : ${post.tags}"
          th:href="@{${tag.status.permalink}}"
          th:text="${tag.spec.displayName}"
        ></a>
      </div>
    </article>

    <nav th:with="cursor = ${postFinder.cursor(post.metadata.name)}">
      <a
        th:if="${cursor.hasPrevious()}"
        th:href="@{${cursor.previous.status.permalink}}"
        th:text="${cursor.previous.spec.title}"
        >Previous</a
      >
      <a
        th:if="${cursor.hasNext()}"
        th:href="@{${cursor.next.status.permalink}}"
        th:text="${cursor.next.spec.title}"
        >Next</a
      >
    </nav>

    <div th:if="${haloCommentEnabled}">
      <halo:comment group="content.halo.run" kind="Post" th:attr="name=${post.metadata.name}" />
    </div>
  </th:block>
</html>
