<!doctype html>
<th:block
  xmlns:th="https://www.thymeleaf.org"
  th:replace="~{components/base-layout/template :: html(
    title = |${author.spec.displayName} - ${site.title}|,
    head = ~{:: head},
    content = ~{:: body},
    header = ~{components/header/template :: body},
    navbar = ~{}
  )}"
>
  <head th:remove="tag">
    <meta
      name="description"
      th:attr="content=${#strings.isEmpty(author.spec.bio) ? site?.seo?.description : author.spec.bio}"
    />
    <link
      th:if="${pluginFinder.available('PluginFeed')}"
      rel="alternate"
      type="application/rss+xml"
      th:title="'Posts - Author: ' + ${author.spec.displayName}"
      th:href="@{'/feed/authors/' + ${author.metadata?.name} + '.xml'}"
    />
    <link
      rel="canonical"
      th:if="${theme.config?.author_page_styles?.is_enable_canonical_link}"
      th:href="${siteUrl} + @{/authors/{slug}(slug = ${author.metadata?.name})}"
    />
    <th:block th:insert="~{components/header/template :: head}"></th:block>
    <th:block th:insert="~{components/list-post-simple/template :: head(showPagination = true)}"></th:block>
    <script type="module" crossorigin src="/themes/howiehz-higan/assets/1.65.0Bk5FHpu.js" integrity="sha384-cg6x7Pb77Zqih642wbHELBIb8vuQ0VeuH0Zb6tWgHC6J1oxIpFMgVUPeGS0CiGHV"></script>
    <link rel="stylesheet" crossorigin href="/themes/howiehz-higan/assets/1.65.0Nu1u8yY.css" integrity="sha384-h6WHiBEsz55L9LeaTSvyYRiiYVLTekMvNJhG+VjwyKti556zI6k8M+nZTayAbuwQ">
    <link rel="stylesheet" crossorigin href="/themes/howiehz-higan/assets/1.65.0Da6uYHG.css" integrity="sha384-qTP+DU13rdm/FAIpfiMTBuNDMN8kf3Z/cbtEhLPpY2fYNgZrYS6K63W4EPWn/7h2">
    <link rel="stylesheet" crossorigin href="/themes/howiehz-higan/assets/1.65.0Bicc1e3.css" integrity="sha384-JZPOQ+7mdAeT6L3rX1fi/Xvhtbr+lZd0Wy165luHFqtcM5hQXidOHfpB5R/zc686">
  </head>
  <body th:remove="tag">
    <article class="author" itemscope itemtype="http://schema.org/BlogPosting">
      <section class="about">
        <div class="relative">
          <div
            class="head-cover absolute tw-pb tw-qb tw-tc"
            th:style="|background-image: url(${#annotations.getOrDefault(author, 'higan.howiehz.top/author-header-image', '')});|"
          ></div>
          <div class="profile-wrap tw-wd">
            <div class="profile-content">
              <picture>
                <source
                  th:with="defaultAvifAvatar = ${#theme.assets('/images/logo.avif')},
                           avatarUri = ${#strings.defaultString(author.spec.avatar, defaultAvifAvatar)},
                           ext=  ${avatarUri.substring(avatarUri.lastIndexOf('.') + 1).toLowerCase()},
                           imageType = ${ext == 'avif' 
                                         ? 'image/avif'
                                         : (ext == 'webp'
                                            ? 'image/webp'
                                            : (ext == 'png'
                                               ? 'image/png'
                                               : (ext == 'apng'
                                                  ? 'image/apng'
                                                  : ((ext == 'jpg'
                                                      or ext == 'jpeg'
                                                      or ext == 'jfif'
                                                      or ext == 'pjpeg'
                                                      or ext == 'pjp')
                                                     ? 'image/jpeg'
                                                     : (ext == 'gif'
                                                        ? 'image/gif'
                                                        : (ext == 'svg'
                                                           ? 'image/svg+xml'
                                                           : (ext == 'bmp'
                                                              ? 'image/bmp'
                                                              : ((ext == 'ico'
                                                                  or ext == 'cur')
                                                                 ? 'image/x-icon'
                                                                 : ((ext == 'tif' 
                                                                     or ext == 'tiff') 
                                                                    ? 'image/tiff'
                                                                    : 'image/png')))))))))}"
                  th:srcset="|${thumbnail.gen(avatarUri, 's')} 400w|"
                  sizes="400px"
                  th:type="${imageType}"
                />
                <source
                  th:with="defaultWebpAvatar = ${#theme.assets('/images/logo.webp')}"
                  th:srcset="|${thumbnail.gen(defaultWebpAvatar, 's')} 400w|"
                  sizes="400px"
                  type="image/webp"
                />
                <img
                  th:with="defaultPngAvatar = ${#theme.assets('/images/logo.png')}"
                  th:src="${defaultPngAvatar}"
                  th:srcset="|${thumbnail.gen(defaultPngAvatar, 's')} 400w|"
                  sizes="400px"
                  class="profile-avatar"
                  width="100%"
                  height="100%"
                  th:alt="#{page.author.avatar-img.alt}"
                />
              </picture>
              <div class="profile-nickname-container">
                <p class="profile-nickname">
                  <span th:text="${author.spec.displayName}">作者名填充位置</span>
                  <th:block
                    th:if="${pluginFinder.available('PluginFeed') and theme.config?.author_page_styles?.is_show_rss_button}"
                  >
                    <a
                      class="icon"
                      th:aria-label="#{common.subscribeThisPage}"
                      th:href="@{'/feed/authors/' + ${author.metadata?.name} + '.xml'}"
                      target="_blank"
                      rel="noopener"
                    >
                      <span class="iconify-middle iconify heroicons-outline--rss"></span
                    ></a>
                  </th:block>
                </p>
                <p class="profile-bio" th:text="${author.spec.bio}"></p>
              </div>
            </div>
          </div>
        </div>
      </section>
      <div class="tw-vc flex tw-mb tw-ac tw-dc">
        <th:block
          th:insert="~{components/list-post-simple/template :: body(posts = ${posts}, showPagination = true, pageTemplateName = 'author')}"
        ></th:block>
      </div>
    </article>
  </body>
</th:block>
