21 lines
875 B
HTML

<header id="header" th:fragment="goPage(page)"
th:class="${page =='home'} ? 'fixed-top d-flex align-items-center header-transparent' : 'fixed-top d-flex align-items-center' ">
<div class="container d-flex justify-content-between align-items-center">
<div class="logo">
<!-- 有 site.logo 时使用图片 -->
<a href="/" th:if="${not #strings.isEmpty(site.logo)}">
<img th:src="${site.logo}" alt="Logo" />
</a>
<!-- 没有 site.logo 时使用文本 -->
<h1 class="text-light" th:if="${#strings.isEmpty(site.logo)}">
<a href="/"><span th:text="${title}"></span></a>
</h1>
<!-- 预加载 logo 图片(如果有) -->
<link th:unless="${#strings.isEmpty(site.logo)}" rel="preload" th:href="${site.logo}" as="image">
</div>
<nav th:replace="modules/navbar.html"></nav>
</div>
</header>