mirror of
https://github.com/halo-dev/theme-earth.git
synced 2025-10-15 15:20:33 +00:00
feat: support for multiple styles of footer
This commit is contained in:
@@ -81,9 +81,48 @@ spec:
|
|||||||
- group: footer
|
- group: footer
|
||||||
label: 页脚
|
label: 页脚
|
||||||
formSchema:
|
formSchema:
|
||||||
|
- $formkit: select
|
||||||
|
name: style
|
||||||
|
id: style
|
||||||
|
key: style
|
||||||
|
label: 页脚风格
|
||||||
|
options:
|
||||||
|
- label: 风格一
|
||||||
|
value: style_1
|
||||||
|
- label: 风格二
|
||||||
|
value: style_2
|
||||||
|
|
||||||
|
- $formkit: attachment
|
||||||
|
name: logo
|
||||||
|
label: Logo
|
||||||
|
help: 如果不设置,将使用站点设置的 Logo
|
||||||
|
|
||||||
|
- $formkit: text
|
||||||
|
name: title
|
||||||
|
label: 标题
|
||||||
|
help: 如果不设置,将使用站点设置的标题
|
||||||
|
|
||||||
|
- $formkit: textarea
|
||||||
|
rows: 3
|
||||||
|
name: slogan
|
||||||
|
id: slogan
|
||||||
|
key: slogan
|
||||||
|
if: "$get(style).value === style_2"
|
||||||
|
label: 标语
|
||||||
|
|
||||||
- $formkit: menuRadio
|
- $formkit: menuRadio
|
||||||
|
if: "$get(style).value === style_1"
|
||||||
name: menu
|
name: menu
|
||||||
label: 页脚菜单
|
id: menu
|
||||||
|
key: menu
|
||||||
|
label: 右侧菜单
|
||||||
|
|
||||||
|
- $formkit: menuCheckbox
|
||||||
|
if: "$get(style).value === style_2"
|
||||||
|
name: menus
|
||||||
|
id: menus
|
||||||
|
key: menus
|
||||||
|
label: 菜单组
|
||||||
|
|
||||||
- group: beian
|
- group: beian
|
||||||
label: 备案设置
|
label: 备案设置
|
||||||
|
2
templates/assets/dist/main.iife.js
vendored
2
templates/assets/dist/main.iife.js
vendored
File diff suppressed because one or more lines are too long
2
templates/assets/dist/style.css
vendored
2
templates/assets/dist/style.css
vendored
File diff suppressed because one or more lines are too long
@@ -1,7 +1,12 @@
|
|||||||
<footer class="mt-10 bg-white py-8">
|
<footer th:if="${theme.config.footer.style == 'style_1'}" class="mt-10 bg-white py-8">
|
||||||
<div class="container mx-auto sm:flex sm:items-center sm:justify-between">
|
<div class="container mx-auto sm:flex sm:items-center sm:justify-between">
|
||||||
<a href="/" class="mb-4 flex items-center justify-center sm:mb-0 sm:justify-start">
|
<a href="/" class="mb-4 flex items-center justify-center sm:mb-0 sm:justify-start">
|
||||||
<img th:src="${site.logo}" class="mr-3 h-8 w-8" th:alt="${site.title}" />
|
<img
|
||||||
|
th:if="${not #strings.isEmpty(theme.config.footer.logo)} or ${not #strings.isEmpty(site.logo)}"
|
||||||
|
th:src="${theme.config.footer.logo ?: site.title}"
|
||||||
|
class="mr-3 h-8 w-8"
|
||||||
|
th:alt="${site.title}"
|
||||||
|
/>
|
||||||
<span class="self-center whitespace-nowrap text-2xl font-semibold" th:text="${site.title}"> </span>
|
<span class="self-center whitespace-nowrap text-2xl font-semibold" th:text="${site.title}"> </span>
|
||||||
</a>
|
</a>
|
||||||
<th:block th:if="${not #strings.isEmpty(theme.config.footer.menu)}">
|
<th:block th:if="${not #strings.isEmpty(theme.config.footer.menu)}">
|
||||||
@@ -12,10 +17,9 @@
|
|||||||
<li th:each="menuItem : ${menu.menuItems}">
|
<li th:each="menuItem : ${menu.menuItems}">
|
||||||
<a
|
<a
|
||||||
th:href="@{${menuItem.status.href}}"
|
th:href="@{${menuItem.status.href}}"
|
||||||
class="mr-4 hover:underline md:mr-6"
|
class="mr-4 transition-all hover:text-gray-900 hover:underline md:mr-6"
|
||||||
th:text="${menuItem.status.displayName}"
|
th:text="${menuItem.status.displayName}"
|
||||||
>首页</a
|
></a>
|
||||||
>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</th:block>
|
</th:block>
|
||||||
@@ -31,8 +35,57 @@
|
|||||||
></a>
|
></a>
|
||||||
</span>
|
</span>
|
||||||
<span class="container mx-auto block text-center text-sm text-gray-500">
|
<span class="container mx-auto block text-center text-sm text-gray-500">
|
||||||
© 2022
|
© <th:block th:text="${#dates.format(new java.util.Date().getTime(), 'yyyy')}" />
|
||||||
<a href="/" class="hover:underline" th:text="${site.title}"></a>. All Rights Reserved. Powered by
|
<a href="/" class="hover:underline" th:text="${site.title}"></a>. All Rights Reserved. Powered by
|
||||||
<a href="https://halo.run" class="hover:underline" target="_blank">Halo</a>.
|
<a href="https://halo.run" class="hover:underline" target="_blank">Halo</a>.
|
||||||
</span>
|
</span>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
<footer th:if="${theme.config.footer.style == 'style_2'}" class="mt-10 bg-white py-8">
|
||||||
|
<div class="container mx-auto md:flex md:justify-between md:gap-10">
|
||||||
|
<div class="mb-6 max-w-full md:mb-0 md:max-w-md">
|
||||||
|
<a href="/" class="mb-6 flex items-center">
|
||||||
|
<img
|
||||||
|
th:if="${not #strings.isEmpty(theme.config.footer.logo)} or ${not #strings.isEmpty(site.logo)}"
|
||||||
|
th:src="${theme.config.footer.logo ?: site.title}"
|
||||||
|
class="mr-3 h-8"
|
||||||
|
th:alt="${site.title}"
|
||||||
|
/>
|
||||||
|
<span class="self-center whitespace-nowrap text-2xl font-semibold" th:text="${site.title}"></span>
|
||||||
|
</a>
|
||||||
|
<span
|
||||||
|
th:if="${not #strings.isEmpty(theme.config.footer.slogan)}"
|
||||||
|
class="text-sm font-light text-gray-600"
|
||||||
|
th:text="${theme.config.footer.slogan}"
|
||||||
|
>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
th:if="${not #lists.isEmpty(theme.config.footer.menus)}"
|
||||||
|
class="grid grid-cols-2 gap-8 sm:grid-cols-4 sm:gap-12"
|
||||||
|
>
|
||||||
|
<th:block th:each="menuName : ${theme.config.footer.menus}">
|
||||||
|
<div th:with="menu = ${menuFinder.getByName(menuName)}">
|
||||||
|
<h2 class="mb-6 text-sm font-semibold text-gray-900" th:text="${menu.spec.displayName}"></h2>
|
||||||
|
<ul th:with="menuItems = ${menu.menuItems}" class="text-sm text-gray-500">
|
||||||
|
<li th:each="menuItem : ${menuItems}" class="mb-4">
|
||||||
|
<a
|
||||||
|
th:href="@{${menuItem.status.href}}"
|
||||||
|
class="transition-all hover:text-gray-900 hover:underline"
|
||||||
|
th:text="${menuItem.spec.displayName}"
|
||||||
|
></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</th:block>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<hr class="my-6 border-gray-200 sm:mx-auto lg:my-8" />
|
||||||
|
<div class="container mx-auto sm:flex sm:items-center">
|
||||||
|
<span class="text-sm text-gray-500 sm:text-center">
|
||||||
|
© <th:block th:text="${#dates.format(new java.util.Date().getTime(), 'yyyy')}" />
|
||||||
|
<a href="/" class="hover:underline" th:text="${site.title}"></a>. All Rights Reserved. Powered by
|
||||||
|
<a href="https://halo.run" class="hover:underline" target="_blank">Halo</a>.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
Reference in New Issue
Block a user