Files
theme-earth/templates/modules/layout.html
Ryan Wang 65847cf9bf fix: resolve CLS issues in page layout
Signed-off-by: Ryan Wang <i@ryanc.cc>
2024-11-15 21:21:10 +08:00

56 lines
2.4 KiB
HTML

<!doctype html>
<html th:lang="${#locale.toLanguageTag}" th:fragment="html (title,hero,content,head,footer,sidebar,contentClass)">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2" />
<title th:text="${title}"></title>
<link th:unless="${#strings.isEmpty(site.logo)}" rel="preload" th:href="${site.logo}" as="image" />
<link rel="stylesheet" th:href="@{/assets/dist/style.css?v={version}(version=${theme.spec.version})}" />
<script th:src="@{/assets/dist/main.iife.js?v={version}(version=${theme.spec.version})}"></script>
<th:block th:if="${head != null}">
<th:block th:replace="${head}" />
</th:block>
<script>
main.initColorScheme("[[${theme.config.style.color_scheme}]]",[[${theme.config.style.enable_change_color_scheme}]])
</script>
</head>
<body class="bg-slate-50 dark:bg-slate-900">
<th:block th:replace="~{modules/header}" />
<th:block th:if="${hero != null}">
<th:block th:replace="${hero}" />
</th:block>
<th:block th:unless="${hero != null}">
<th:block th:replace="~{modules/hero :: hero(isHome = true, cover = null, title = null)}" />
</th:block>
<section
class="mx-auto mt-6 grid max-w-7xl grid-cols-1 gap-6 px-4 md:grid-cols-[1fr_18rem] lg:px-6"
th:classappend="${contentClass}"
>
<div class="z-0 min-w-0">
<th:block th:replace="${content}" />
</div>
<th:block th:if="${sidebar != null}">
<th:block th:replace="${sidebar}" />
</th:block>
<th:block th:if="${sidebar == null}">
<th:block th:replace="~{modules/sidebar :: sidebar(prepend = null)}" />
</th:block>
</section>
<th:block th:replace="~{modules/footer}" />
<th:block th:if="${footer != null}">
<th:block th:replace="${footer}" />
</th:block>
<button
th:if="${theme.config.global.show_scroll_button}"
type="button"
id="btn-scroll-to-top"
aria-label="回到顶部"
class="fixed bottom-5 right-5 flex items-center justify-center rounded-full bg-white p-3 opacity-0 shadow transition-all duration-300 hover:opacity-70 hover:shadow-lg dark:bg-slate-600 lg:bottom-10 lg:right-10"
>
<span class="i-tabler-chevron-up text-2xl text-gray-600 dark:text-slate-200"></span>
</button>
</body>
</html>