<!doctype html>
<th:block
  xmlns:th="https://www.thymeleaf.org"
  th:replace="~{components/base-layout/template :: html(
    title = ${#strings.isEmpty(theme.config?.index_styles?.page_html_title) ? site.title : theme.config?.index_styles?.page_html_title},
    head = ~{:: head},
    content = ~{:: body},
    header = ~{components/header/template :: body},
    navbar = ~{}
  )}"
>
  <head th:remove="tag">
    <link rel="canonical" th:if="${theme.config?.index_styles?.is_enable_canonical_link}" th:href="${siteUrl}" />
    <th:block th:insert="~{components/header/template :: head}"></th:block>
    <th:block th:if="${theme.config?.index_styles?.quote}">
      <th:block th:insert="~{components/quote-fetcher/template :: head}"></th:block>
    </th:block>
    <th:block th:if="${theme.config?.index_styles?.list_layout == 'post-list-summary'}">
      <th:block th:insert="~{components/list-post-summary/template :: head}"></th:block>
    </th:block>
    <th:block th:if="${theme.config?.index_styles?.list_layout == 'simple-post-list'}">
      <th:block th:insert="~{components/list-post-simple/template :: head(showPagination = true)}"></th:block>
    </th:block>
    <th:block
      th:if="${theme.config?.index_styles?.list_layout == 'moment-list-summary'
               and pluginFinder.available('PluginMoments')}"
    >
      <th:block th:insert="~{components/list-moment-summary/template :: head(pageTemplateName = 'index')}"></th:block>
    </th:block>
    <th:block
      th:if="${theme.config?.index_styles?.list_layout == 'friends-list-summary'
               and pluginFinder.available('plugin-friends')}"
    >
      <th:block
        th:insert="~{components/list-friends-summary/template :: head(
                       friends=${friendFinder.list({
                         page: posts.page,
                         size: theme.config?.index_styles?.friends_list_page_size
                       })}
                   )}"
      ></th:block>
    </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">
  </head>
  <body th:remove="tag">
    <section id="about">
      <th:block th:if="${theme.config?.index_styles?.quote}">
        <th:block th:insert="~{components/quote-fetcher/template :: body}"></th:block>
      </th:block>
      <th:block
        th:if="${theme.config?.index_styles?.is_random_sentence_show and !#lists.isEmpty(theme.config?.index_styles?.random_sentence_list)}"
      >
        <p
          th:with="randomIndex = ${T(java.lang.Math).floor(T(java.lang.Math).random() * #lists.size(theme.config?.index_styles?.random_sentence_list))}"
          id="randomSentence"
          th:text="${theme.config?.index_styles?.random_sentence_list[randomIndex]['sentence']}"
        ></p>
      </th:block>
      <th:block th:if="${theme.config?.index_styles?.is_resume_show}">
        <p
          class="blog-description"
          th:with="defaultResume = ${#strings.defaultString(site?.seo?.description, '')}"
          th:utext="${#strings.defaultString(theme.config?.index_styles?.resume, defaultResume)}"
        ></p>
      </th:block>
      <th:block
        th:if="${theme.config?.index_styles?.is_i18n_resume_show}"
        th:with="resumeItems = ${theme.config?.index_styles?.i18n_resume}"
      >
        <th:block th:unless="${theme.config?.global?.is_i18n_prefix_match_mode}">
          <th:block th:each="resumeItem : ${resumeItems}">
            <th:block th:if="${#strings.equals(resumeItem.lang, page_language)}">
              <p
                class="blog-description matched-resume"
                th:with="defaultResume = ${#strings.defaultString(site?.seo?.description, '')}"
                th:utext="${#strings.defaultString(resumeItem.resume, defaultResume)}"
              ></p>
            </th:block>
          </th:block>
        </th:block>
        <th:block th:if="${theme.config?.global?.is_i18n_prefix_match_mode}">
          <th:block th:each="resumeItem : ${resumeItems}">
            <th:block
              th:if="${page_language != null
                       and resumeItem.lang != null
                       and #strings.startsWith(page_language, resumeItem.lang)}"
            >
              <p
                class="blog-description matched-resume"
                th:with="defaultResume = ${#strings.defaultString(site?.seo?.description, '')}"
                th:utext="${#strings.defaultString(resumeItem.resume, defaultResume)}"
              ></p>
            </th:block>
          </th:block>
        </th:block>
        <th:block th:each="resumeItem : ${resumeItems}">
          <th:block th:if="${#strings.equals(resumeItem.lang, theme.config?.global?.default_page_language)}">
            <p
              class="blog-description default-resume"
              style="display: none"
              th:with="defaultResume = ${#strings.defaultString(site?.seo?.description, '')}"
              th:utext="${#strings.defaultString(resumeItem.resume, defaultResume)}"
            ></p>
          </th:block>
        </th:block>
      </th:block>
    </section>
    <p id="findMe" th:unless="${#arrays.isEmpty(theme.config?.sns?.sns_list)}">
      <th:block th:text="#{page.index.findMeLeftText}" th:if="${theme.config?.index_styles?.is_show_find_me_left_text}">
        社交资料图标左侧文字替换位</th:block
      >
      <th:block th:each="item : ${theme.config?.sns?.sns_list}">
        <th:block
          th:unless="${item?.type == 'text' or item?.type == 'custom_sns'}"
          th:with="snsUrl = ${
            item?.type == 'rss' ? '@VALUE' :
            item?.type == 'bilibili' ? 'https://space.bilibili.com/@VALUE' :
            item?.type == 'dribbble' ? 'https://dribbble.com/@VALUE' :
            item?.type == 'email' ? 'mailto:@VALUE' :
            item?.type == 'facebook' ? 'https://www.facebook.com/@VALUE' :
            item?.type == 'github' ? 'https://github.com/@VALUE' :
            item?.type == 'instagram' ? 'https://www.instagram.com/@VALUE' :
            item?.type == 'qq' ? 'tencent://message/?Site=&Menu=yes&uin=@VALUE' :
            item?.type == 'reddit' ? 'https://www.reddit.com/user/@VALUE' :
            item?.type == 'stack_overflow' ? 'https://stackoverflow.com/users/@VALUE' :
            item?.type == 'telegram' ? 'https://t.me/@VALUE' :
            item?.type == 'x' ? 'https://x.com/@VALUE' :
            item?.type == 'youtube' ? 'https://www.youtube.com/channel/@VALUE' :
            item?.type == 'douban' ? 'https://www.douban.com/people/@VALUE' :
            item?.type == 'neteasecloudmusic' ? 'https://music.163.com/#/user/home?id=@VALUE' :
            item?.type == 'weibo' ? 'https://weibo.com/@VALUE' :
            item?.type == 'zhihu' ? 'https://www.zhihu.com/people/@VALUE' :
            '@VALUE'},
          snsAriaLabel = ${
            item?.type == 'rss' ? 'Find me on RSS' :
            item?.type == 'bilibili' ? 'Find me on BiliBili' :
            item?.type == 'dribbble' ? 'Find me on Dribbble' :
            item?.type == 'email' ? 'Find me on Email' :
            item?.type == 'facebook' ? 'Find me on Facebook' :
            item?.type == 'github' ? 'Find me on GitHub' :
            item?.type == 'instagram' ? 'Find me on Instagram' :
            item?.type == 'qq' ? 'Find me on QQ' :
            item?.type == 'reddit' ? 'Find me on Reddit' :
            item?.type == 'stack_overflow' ? 'Find me on Stack Overflow' :
            item?.type == 'telegram' ? 'Find me on Telegram' :
            item?.type == 'x' ? 'Find me on X' :
            item?.type == 'youtube' ? 'Find me on YouTube' :
            item?.type == 'douban' ? 'Find me on Douban' :
            item?.type == 'neteasecloudmusic' ? 'Find me on NetEase CloudMusic' :
            item?.type == 'weibo' ? 'Find me on Weibo' :
            item?.type == 'zhihu' ? 'Find me on Zhihu' :
            ''}"
        >
          <a
            class="icon"
            th:href="${#strings.replace(snsUrl, '@VALUE', item?.input_value)}"
            target="_blank"
            th:attr="aria-label=${snsAriaLabel}"
          >
            <span class="iconify-middle iconify heroicons-outline--rss" th:if="${item?.type == 'rss'}"></span>
            <span class="iconify-middle iconify simple-icons--bilibili" th:if="${item?.type == 'bilibili'}"></span>
            <span
              class="iconify-middle iconify ant-design--dribbble-circle-filled"
              th:if="${item?.type == 'dribbble'}"
            ></span>
            <span class="iconify-middle iconify ic--outline-email" th:if="${item?.type == 'email'}"></span>
            <span class="iconify-middle iconify ic--baseline-facebook" th:if="${item?.type == 'facebook'}"></span>
            <span class="iconify-middle iconify mdi--github" th:if="${item?.type == 'github'}"></span>
            <span
              class="iconify-middle iconify ant-design--instagram-filled"
              th:if="${item?.type == 'instagram'}"
            ></span>
            <span class="iconify-middle iconify ant-design--qq-circle-filled" th:if="${item?.type == 'qq'}"></span>
            <span
              class="iconify-middle iconify ant-design--reddit-circle-filled"
              th:if="${item?.type == 'reddit'}"
            ></span>
            <span class="iconify-middle iconify mdi--stack-overflow" th:if="${item?.type == 'stack_overflow'}"></span>
            <span class="iconify-middle iconify ic--baseline-telegram" th:if="${item?.type == 'telegram'}"></span>
            <span class="iconify-middle iconify ant-design--twitter-circle-filled" th:if="${item?.type == 'x'}"></span>
            <span class="iconify-middle iconify ant-design--youtube-filled" th:if="${item?.type == 'youtube'}"></span>
            <span class="iconify-middle iconify ri--douban-line" th:if="${item?.type == 'douban'}"></span>
            <span
              class="iconify-middle iconify simple-icons--neteasecloudmusic"
              th:if="${item?.type == 'neteasecloudmusic'}"
            ></span>
            <span
              class="iconify-middle iconify ant-design--weibo-circle-filled"
              th:if="${item?.type == 'weibo'}"
            ></span>
            <span
              class="iconify-middle iconify ant-design--zhihu-circle-filled"
              th:if="${item?.type == 'zhihu'}"
            ></span>
          </a>
        </th:block>
        <th:block th:if="${item?.type == 'text'}"><span th:text="${item?.input_value}"></span></th:block>
        <th:block th:if="${item?.type == 'custom_sns'}">
          <th:block
            th:each="custom_sns_item : ${theme.config?.sns?.custom_sns}"
            th:if="${item?.input_value == custom_sns_item?.id}"
          >
            <a
              class="icon"
              th:href="@{${custom_sns_item?.url}}"
              target="_blank"
              th:attr="aria-label=${custom_sns_item?.aria_label}"
            >
              <span class="iconify-middle iconify" th:style="|--svg:url('${custom_sns_item?.icon.value}')|"></span>
            </a>
          </th:block>
        </th:block>
      </th:block>
    </p>
    <th:block th:if="${theme.config?.index_styles?.list_layout == 'post-list-summary'}">
      <h1 th:if="${theme.config?.index_styles?.is_show_index_post_list_title}">
        <a th:href="@{/archives}" th:text="#{page.index.postListTitle}">首页文章列表标题替换位</a>
      </h1>
      <th:block
        th:insert="~{components/list-post-summary/template :: body(posts = ${posts}, pageTemplateName = 'index')}"
      ></th:block>
    </th:block>
    <th:block th:if="${theme.config?.index_styles?.list_layout == 'simple-post-list'}">
      <h1 th:if="${theme.config?.index_styles?.is_show_index_post_list_title}">
        <a th:href="@{/archives}" th:text="#{page.index.postListTitle}">首页文章列表标题替换位</a>
      </h1>
      <th:block
        th:insert="~{components/list-post-simple/template :: body(posts = ${posts}, showPagination = true, pageTemplateName = 'index')}"
      ></th:block>
    </th:block>
    <th:block th:if="${theme.config?.index_styles?.list_layout == 'moment-list-summary'}">
      <th:block th:if="${pluginFinder.available('PluginMoments')}">
        <th:block
          th:insert="~{components/list-moment-summary/template :: body(
            moments = ${momentFinder.list(
              posts.page,
              theme.config?.index_styles?.moment_list_page_size)},
            pageTemplateName = 'index'
          )}"
        ></th:block>
      </th:block>
      <th:block th:unless="${pluginFinder.available('PluginMoments')}">
        <p th:text="#{page.index.momentsPluginNotAvailable}">插件未启用提示替换位</p>
        <p>
          <span th:text="#{page.index.momentsPluginNotAvailableDescription}"></span>
          <a
            th:text="#{page.index.momentsPluginDocsLinkText}"
            th:href="#{page.index.momentsPluginDocsLink}"
            rel="noopener"
            target="_blank"
          ></a>
        </p>
      </th:block>
    </th:block>
    <th:block th:if="${theme.config?.index_styles?.list_layout == 'friends-list-summary'}">
      <th:block th:if="${pluginFinder.available('plugin-friends')}">
        <th:block
          th:insert="~{components/list-friends-summary/template :: body(
            friends = ${friendFinder.list({
              page: posts.page,
              size: theme.config?.index_styles?.friends_list_page_size})},
            pageTemplateName = 'index'
          )}"
        ></th:block>
      </th:block>
      <th:block th:unless="${pluginFinder.available('plugin-friends')}">
        <p th:text="#{page.index.friendsPluginNotAvailable}">插件未启用提示替换位</p>
        <p>
          <span th:text="#{page.index.friendsPluginNotAvailableDescription}"></span>
          <a
            th:text="#{page.index.friendsPluginDocsLinkText}"
            th:href="#{page.index.friendsPluginDocsLink}"
            rel="noopener"
            target="_blank"
          ></a>
        </p>
      </th:block>
    </th:block>
  </body>
</th:block>
