fix: resolve CLS issues in page layout (#209)

Signed-off-by: Ryan Wang <i@ryanc.cc>
This commit is contained in:
Ryan Wang
2024-11-17 13:25:11 +08:00
committed by GitHub
parent 1f219604ec
commit 235c2c20ef
6 changed files with 10 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
<!doctype html> <!doctype html>
<html <html
xmlns:th="https://www.thymeleaf.org" xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(title = '归档 - ' + ${site.title}, hero = null, content = ~{::content}, head = null, footer = null, sidebar = ~{::sidebar}, contentClass = '')}" th:replace="~{modules/layout :: html(title = '归档 - ' + ${site.title}, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = '')}"
> >
<th:block th:fragment="content"> <th:block th:fragment="content">
<div class="rounded-xl bg-white p-4 dark:bg-slate-800"> <div class="rounded-xl bg-white p-4 dark:bg-slate-800">

View File

@@ -1,7 +1,7 @@
<!doctype html> <!doctype html>
<html <html
xmlns:th="https://www.thymeleaf.org" xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(title = '链接 - ' + ${site.title}, hero = null, content = ~{::content}, head = null, footer = null, sidebar = ~{::sidebar}, contentClass = '')}" th:replace="~{modules/layout :: html(title = '链接 - ' + ${site.title}, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = '')}"
> >
<th:block th:fragment="content"> <th:block th:fragment="content">
<div class="rounded-xl bg-white p-4 dark:bg-slate-800"> <div class="rounded-xl bg-white p-4 dark:bg-slate-800">

View File

@@ -23,8 +23,11 @@
<th:block th:unless="${hero != null}"> <th:block th:unless="${hero != null}">
<th:block th:replace="~{modules/hero :: hero(isHome = true, cover = null, title = null)}" /> <th:block th:replace="~{modules/hero :: hero(isHome = true, cover = null, title = null)}" />
</th:block> </th:block>
<section class="mx-auto mt-6 flex max-w-7xl gap-6 px-4 lg:px-6" th:classappend="${contentClass}"> <section
<div class="z-0 min-w-0 flex-1 shrink"> 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}" /> <th:block th:replace="${content}" />
</div> </div>
<th:block th:if="${sidebar != null}"> <th:block th:if="${sidebar != null}">

View File

@@ -1,4 +1,4 @@
<aside th:fragment="sidebar (prepend)" class="z-0 hidden w-72 flex-none flex-col gap-6 md:flex"> <aside th:fragment="sidebar (prepend)" class="z-0 hidden w-72 flex-col gap-6 md:flex">
<th:block th:with="widgets = ${theme.config.sidebar.widgets} "> <th:block th:with="widgets = ${theme.config.sidebar.widgets} ">
<th:block th:if="${prepend != null}"> <th:block th:if="${prepend != null}">
<th:block th:replace="${prepend}" /> <th:block th:replace="${prepend}" />

View File

@@ -1,7 +1,7 @@
<!doctype html> <!doctype html>
<html <html
xmlns:th="https://www.thymeleaf.org" xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(title = '瞬间 - ' + ${site.title}, hero = null, content = ~{::content}, head = null, footer = null, sidebar = ~{::sidebar}, contentClass = '')}" th:replace="~{modules/layout :: html(title = '瞬间 - ' + ${site.title}, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = '')}"
> >
<th:block th:fragment="content"> <th:block th:fragment="content">
<div class="rounded-xl bg-white p-4 dark:bg-slate-800"> <div class="rounded-xl bg-white p-4 dark:bg-slate-800">

View File

@@ -1,7 +1,7 @@
<!doctype html> <!doctype html>
<html <html
xmlns:th="https://www.thymeleaf.org" xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(title = '图库 - ' + ${site.title}, hero = null, content = ~{::content}, head = null, footer = null, sidebar = ~{::sidebar}, contentClass = '')}" th:replace="~{modules/layout :: html(title = '图库 - ' + ${site.title}, hero = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = '')}"
> >
<th:block th:fragment="content"> <th:block th:fragment="content">
<div class="rounded-xl bg-white p-4 dark:bg-slate-800"> <div class="rounded-xl bg-white p-4 dark:bg-slate-800">