Skip to content

Commit

Permalink
pref: 优化移动端标题
Browse files Browse the repository at this point in the history
  • Loading branch information
AirboZH committed Oct 12, 2023
1 parent d473620 commit b4411b2
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 56 deletions.
2 changes: 1 addition & 1 deletion templates/archives.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
th:replace="~{modules/layout :: html (title = '归档', content = ~{::content},
layout = 'archives', breadcrumb = ~{::breadcrumb})}"
layout = 'Archives', breadcrumb = ~{::breadcrumb})}"
xmlns:th="https://www.thymeleaf.org"
>
<th:block th:fragment="breadcrumb">
Expand Down
2 changes: 1 addition & 1 deletion templates/categories.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
th:replace="~{modules/layout :: html (title = '分类',content = ~{::content},
layout = 'categories', breadcrumb = ~{::breadcrumb})}"
layout = 'Categories', breadcrumb = ~{::breadcrumb})}"
xmlns:th="https://www.thymeleaf.org"
>
<th:block th:fragment="breadcrumb">
Expand Down
2 changes: 1 addition & 1 deletion templates/category.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
th:replace="~{modules/layout :: html (title = '分类:'+ ${category.spec.displayName},
content = ~{::content}, layout = '分类' ,breadcrumb = ~{::breadcrumb})}"
content = ~{::content}, layout = 'Category' ,breadcrumb = ~{::breadcrumb})}"
xmlns:th="https://www.thymeleaf.org"
>
<th:block th:fragment="breadcrumb">
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
th:replace="~{modules/layout :: html (title = '', content = ~{::content},
layout = 'default', breadcrumb = ~{::breadcrumb})}"
layout = 'Default', breadcrumb = ~{::breadcrumb})}"
xmlns:th="https://www.thymeleaf.org"
>
<th:block th:fragment="breadcrumb">
Expand Down
140 changes: 92 additions & 48 deletions templates/modules/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,100 @@
lang="en"
th:fragment="html (title,content,layout,breadcrumb)"
>
<th:block th:replace="~{modules/head :: head(${title})}" />
<th:block th:replace="~{modules/head :: head(${title})}"/>

<body>
<th:block th:replace="~{modules/sidebar :: sidebar()}" />
<div id="main-wrapper" class="d-flex justify-content-center">
<div class="container d-flex flex-column px-xxl-5">
<th:block th:replace="~{modules/topbar :: topbar(${breadcrumb}, ${layout})}"/>
<div class="row flex-grow-1">
<main
aria-label="Main Content"
class="col-12 col-lg-11 col-xl-9 px-md-4 pb-5"
th:switch="${layout}"
>
<th:block th:case="default">
<th:block th:replace="${content}" />
</th:block>
<th:block th:case="*">
<article class="px-1">
<th:block th:replace="${content}" />
</article>
</th:block>
</main>
<body>
<th:block th:replace="~{modules/sidebar :: sidebar()}"/>
<div id="main-wrapper" class="d-flex justify-content-center">
<div class="container d-flex flex-column px-xxl-5">
<th:block th:switch="${layout}">
<th:block th:case="Default">
<th:block
th:replace="~{modules/topbar :: topbar(${breadcrumb}, ${site.title})}"
/>
</th:block>
<th:block th:case="Tag">
<th:block
th:replace="~{modules/topbar :: topbar(${breadcrumb}, 标签)}"
/>
</th:block>
<th:block th:case="Tags">
<th:block
th:replace="~{modules/topbar :: topbar(${breadcrumb}, 标签)}"
/>
</th:block>
<th:block th:case="Category">
<th:block
th:replace="~{modules/topbar :: topbar(${breadcrumb}, 分类)}"
/>
</th:block>
<th:block th:case="Categories">
<th:block
th:replace="~{modules/topbar :: topbar(${breadcrumb}, 分类)}"
/>
</th:block>
<th:block th:case="Archives">
<th:block
th:replace="~{modules/topbar :: topbar(${breadcrumb}, 归档)}"
/>
</th:block>
<th:block th:case="Post">
<th:block
th:replace="~{modules/topbar :: topbar(${breadcrumb}, 文章)}"
/>
</th:block>
<th:block th:case="*">
<th:block
th:replace="~{modules/topbar :: topbar(${breadcrumb}, ' ')}"
/>
</th:block>
</th:block>
<div class="row flex-grow-1">
<main
aria-label="Main Content"
class="col-12 col-lg-11 col-xl-9 px-md-4 pb-5"
th:switch="${layout}"
>
<th:block th:case="Default">
<th:block th:replace="${content}"/>
</th:block>
<th:block th:case="Page">
<th:block th:replace="${content}"/>
</th:block>
<th:block th:case="*">
<article class="px-1">
<th:block th:replace="${content}"/>
</article>
</th:block>
</main>

<!-- panel -->
<aside
aria-label="Panel"
id="panel-wrapper"
class="col-xl-3 ps-2 text-muted"
>
<th:block th:replace="~{modules/panel :: panel(${layout})}" />
</aside>
</div>
<div class="row">
<!-- tail -->
<div id="tail-wrapper" class="col-12 col-lg-11 col-xl-9 px-md-4">
<th:block th:replace="~{modules/footer :: footer()}" />
</div>
</div>
</div>

<aside aria-label="Scroll to Top">
<button
id="back-to-top"
type="button"
class="btn btn-lg btn-box-shadow"
>
<i class="fas fa-angle-up"></i>
</button>
<!-- panel -->
<aside
aria-label="Panel"
id="panel-wrapper"
class="col-xl-3 ps-2 text-muted"
>
<th:block th:replace="~{modules/panel :: panel(${layout})}"/>
</aside>
</div>
<div id="mask"></div>
</body>
<div class="row">
<!-- tail -->
<div id="tail-wrapper" class="col-12 col-lg-11 col-xl-9 px-md-4">
<th:block th:replace="~{modules/footer :: footer()}"/>
</div>
</div>
</div>

<aside aria-label="Scroll to Top">
<button
id="back-to-top"
type="button"
class="btn btn-lg btn-box-shadow"
>
<i class="fas fa-angle-up"></i>
</button>
</aside>
</div>
<div id="mask"></div>
</body>
</html>
2 changes: 1 addition & 1 deletion templates/page.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
th:replace="~{modules/layout :: html (title = ${singlePage.spec.title},
content = ~{::content}, layout = 'default' ,breadcrumb = ~{::breadcrumb})}"
content = ~{::content}, layout = 'Page' ,breadcrumb = ~{::breadcrumb})}"
xmlns:th="https://www.thymeleaf.org"
>
<th:block th:fragment="breadcrumb">
Expand Down
2 changes: 1 addition & 1 deletion templates/post.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
th:replace="~{modules/layout :: html (title =${post.spec.title},
content = ~{::content}, layout = 'post', breadcrumb = ~{::breadcrumb})}"
content = ~{::content}, layout = 'Post', breadcrumb = ~{::breadcrumb})}"
xmlns:th="https://www.thymeleaf.org"
>
<th:block th:fragment="breadcrumb">
Expand Down
2 changes: 1 addition & 1 deletion templates/tag.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
th:replace="~{modules/layout :: html (title = '标签:'+ ${tag.spec.displayName},
content =~{::content}, layout = '标签', breadcrumb = ~{::breadcrumb})}"
content =~{::content}, layout = 'Tag', breadcrumb = ~{::breadcrumb})}"
xmlns:th="https://www.thymeleaf.org"
>
<th:block th:fragment="breadcrumb">
Expand Down
2 changes: 1 addition & 1 deletion templates/tags.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html
th:replace="~{modules/layout :: html (title = '标签', content = ~{::content},
layout = 'tags' ,breadcrumb = ~{::breadcrumb})}"
layout = 'Tags' ,breadcrumb = ~{::breadcrumb})}"
xmlns:th="https://www.thymeleaf.org"
>
<th:block th:fragment="breadcrumb">
Expand Down

0 comments on commit b4411b2

Please sign in to comment.