Skip to content

Commit

Permalink
fix: 修复 docker 部署时出现的报错
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieHz committed Nov 23, 2024
1 parent 189ab15 commit 2ba27e3
Showing 1 changed file with 53 additions and 51 deletions.
104 changes: 53 additions & 51 deletions templates/fragments/common.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,63 @@
</ul>
</th:block>

<th:block th:fragment="base-menu">
<th:block th:unless="${theme.config?.global?.is_i18n_menu_show}">
<!-- 普通 menu -->
<li th:each="menuItem : ${menuFinder.getPrimary().menuItems}" class="matched-menu">
<a
th:href="@{${menuItem.status?.href}}"
th:target="${menuItem.spec.target?.value}"
th:aria-label="#{fragment.menu.menuItem.aria-label(${menuItem.status?.displayName})}"
th:text="${menuItem.status?.displayName}"
>目录项填充位置</a
>
</li>
</th:block>
<th:block th:fragment="base-menu" th:with="menu = ${menuFinder?.getPrimary()}">
<th:block th:with="menuItems = ${menu?.menuItems}">
<th:block th:unless="${theme.config?.global?.is_i18n_menu_show}">
<!-- 普通 menu -->
<li th:each="menuItem : ${menuItems}" class="matched-menu">
<a
th:href="@{${menuItem?.status?.href}}"
th:target="${menuItem?.spec?.target?.value}"
th:aria-label="#{fragment.menu.menuItem.aria-label(${menuItem.status?.displayName})}"
th:text="${menuItem?.status?.displayName}"
>目录项填充位置</a
>
</li>
</th:block>

<th:block
th:if="${theme.config?.global?.is_i18n_menu_show} and not ${theme.config?.global?.is_i18n_menu_prefix_match_mode}"
>
<!-- i18n menu 全等匹配模式 -->
<th:block th:each="menuItem : ${menuFinder.getPrimary().menuItems}">
<th:block th:if="${#strings.equals(menuItem.spec.displayName, #locale)}">
<li th:each="menuItemChildren : ${menuItem.children}" class="matched-menu">
<a
th:href="@{${menuItemChildren.status?.href}}"
th:target="${menuItemChildren.spec.target?.value}"
th:aria-label="#{fragment.menu.menuItem.aria-label(${menuItemChildren.status?.displayName})}"
th:text="${menuItemChildren.status?.displayName}"
>目录项填充位置</a
>
</li>
<th:block
th:if="${theme.config?.global?.is_i18n_menu_show} and not ${theme.config?.global?.is_i18n_menu_prefix_match_mode}"
>
<!-- i18n menu 全等匹配模式 -->
<th:block th:each="menuItem : ${menuItems}">
<th:block th:if="${#strings.equals(menuItem.spec.displayName, #locale)}">
<li th:each="menuItemChildren : ${menuItem?.children}" class="matched-menu">
<a
th:href="@{${menuItemChildren?.status?.href}}"
th:target="${menuItemChildren?.spec?.target?.value}"
th:aria-label="#{fragment.menu.menuItem.aria-label(${menuItemChildren.status?.displayName})}"
th:text="${menuItemChildren?.status?.displayName}"
>目录项填充位置</a
>
</li>
</th:block>
</th:block>
</th:block>

<th:block
th:if="${theme.config?.global?.is_i18n_menu_show} and ${theme.config?.global?.is_i18n_menu_prefix_match_mode}"
>
<!-- i18n menu 前缀匹配模式 -->
<th:block th:each="menuItem : ${menuItems}">
<th:block th:if="${#strings.startsWith(#locale, menuItem.spec.displayName)}">
<li th:each="menuItemChildren : ${menuItem?.children}" class="matched-menu">
<a
th:href="@{${menuItemChildren?.status?.href}}"
th:target="${menuItemChildren?.spec?.target?.value}"
th:aria-label="#{fragment.menu.menuItem.aria-label(${menuItemChildren.status?.displayName})}"
th:text="${menuItemChildren?.status?.displayName}"
>目录项填充位置</a
>
</li>
</th:block>
</th:block>
</th:block>
</th:block>

<th:block
th:if="${theme.config?.global?.is_i18n_menu_show} and ${theme.config?.global?.is_i18n_menu_prefix_match_mode}"
>
<!-- i18n menu 前缀匹配模式 -->
<th:block th:each="menuItem : ${menuFinder.getPrimary().menuItems}">
<th:block th:if="${#strings.startsWith(#locale, menuItem.spec.displayName)}">
<li th:each="menuItemChildren : ${menuItem.children}" class="matched-menu">
<!-- i18n menu 全等匹配模式 匹配默认菜单 -->
<th:block th:each="menuItem : ${menuItems}">
<th:block th:if="${#strings.equals(menuItem.spec.displayName, theme.config?.global?.defalut_i18n_menu_name)}">
<li th:each="menuItemChildren : ${menuItem.children}" style="display: none" class="default-menu">
<a
th:href="@{${menuItemChildren.status?.href}}"
th:target="${menuItemChildren.spec.target?.value}"
Expand All @@ -67,21 +84,6 @@
</th:block>
</th:block>
</th:block>

<!-- i18n menu 全等匹配模式 匹配默认菜单 -->
<th:block th:each="menuItem : ${menuFinder.getPrimary().menuItems}">
<th:block th:if="${#strings.equals(menuItem.spec.displayName, theme.config?.global?.defalut_i18n_menu_name)}">
<li th:each="menuItemChildren : ${menuItem.children}" style="display: none" class="default-menu">
<a
th:href="@{${menuItemChildren.status?.href}}"
th:target="${menuItemChildren.spec.target?.value}"
th:aria-label="#{fragment.menu.menuItem.aria-label(${menuItemChildren.status?.displayName})}"
th:text="${menuItemChildren.status?.displayName}"
>目录项填充位置</a
>
</li>
</th:block>
</th:block>
</th:block>

<th:block th:fragment="share">
Expand Down

0 comments on commit 2ba27e3

Please sign in to comment.