chore: 导航内容适配
This commit is contained in:
		
							parent
							
								
									9c4fc6afbc
								
							
						
					
					
						commit
						df49ce3044
					
				| @ -3,63 +3,62 @@ | ||||
|         <div class="container<#if settings.sidebar_column?? && settings.sidebar_column!='all'> two-column</#if>"> | ||||
|             <i class="fa fa-bars navbar-slideicon"></i> | ||||
|             <a class="navbar-item logo-title"  th:href="${site.url}"> | ||||
|                 <th:block if="${site.logo != ''}"> | ||||
|                 <th:block th:if="${#strings.isEmpty(site.logo)}" th:text="${site.title}"/> | ||||
|                 <th:block th:unless="${#strings.isEmpty(site.logo)}"> | ||||
|                     <img class="logo-img" th:src="${site.logo}" th:alt="${site.title}" height="28"> | ||||
|                     <img class="logo-img-dark" th:src="${site.logo}" th:alt="${site.title}" height="28"> | ||||
|                     <img class="logo-img-dark" th:src="${#annotations.getOrDefault(theme.config.basic_info, 'night_logo', ${site.logo})}" th:alt="${site.title}" height="28"> | ||||
|                 </th:block> | ||||
|                 <th:block if="${site.logo == ''}" th:text="${site.title}"/> | ||||
|             </a> | ||||
| <!--            <nav class="navbar-nav active-animate">--> | ||||
| <!--                <@menuTag method="tree">--> | ||||
| <!--                    <#list menus?sort_by('priority') as menu>--> | ||||
| <!--                        <#if menu.children?? && menu.children?size gt 0>--> | ||||
| <!--                            <#if menu.name?default('')?starts_with('#hide') != true>--> | ||||
| <!--                                <div class="item-dropdown" trigger="hover" placement="60px">--> | ||||
| <!--                                    <div class="item-dropdown-link">--> | ||||
| <!--                                        <#if menu.url!='#'>--> | ||||
| <!--                                            <a class="item" href="${menu.url!}" target="${menu.target!}" title="${menu.name!}"><#if menu.icon?? && menu.icon!=''><i class="m-icon ${menu.icon}"></i></#if>${menu.name!}</a>--> | ||||
| <!--                                        <#else>--> | ||||
| <!--                                            <a class="item" style="cursor:default;" href="javascript:" title="${menu.name!}"><#if menu.icon?? && menu.icon!=''><i class="m-icon ${menu.icon}"></i></#if>${menu.name!}</a>--> | ||||
| <!--                                        </#if>--> | ||||
| <!--                                        <i class="fa fa-angle-down item-dropdown-link-icon" style="color:var(--main)"></i>--> | ||||
| <!--                                    </div>--> | ||||
| <!--                                    <nav class="item-dropdown-menu">--> | ||||
| <!--                                        <#list menu.children?sort_by('priority') as child>--> | ||||
| <!--                                            <#if child.children?? && child.children?size gt 0>--> | ||||
| <!--                                                <#if child.name?default('')?starts_with('#hide') != true>--> | ||||
| <!--                                                    <li class="item-sub-li">--> | ||||
| <!--                                                        <a class="item" href="${child.url!}" target="${child.target!}" title="${child.name!}"><#if child.icon?? && child.icon!=''><i class="m-icon ${child.icon}"></i></#if>${child.name!}</a>--> | ||||
| <!--                                                        <ol class="item-sub">--> | ||||
| <!--                                                            <#list child.children?sort_by('priority') as child1>--> | ||||
| <!--                                                                <#if child1.name?default('')?starts_with('#hide') != true>--> | ||||
| <!--                                                                    <li>--> | ||||
| <!--                                                                        <a class="item" href="${child1.url!}" target="${child1.target!}" title="${child1.name!}"><#if child1.icon?? && child1.icon!=''><i class="m-icon ${child1.icon}"></i></#if>${child1.name!}</a>--> | ||||
| <!--                                                                    </li>--> | ||||
| <!--                                                                </#if>--> | ||||
| <!--                                                            </#list>--> | ||||
| <!--                                                        </ol>--> | ||||
| <!--                                                    </li>--> | ||||
| <!--                                                </#if>--> | ||||
| <!--                                            <#else>--> | ||||
| <!--                                                <#if child.name?default('')?starts_with('#hide') != true>--> | ||||
| <!--                                                    <li>--> | ||||
| <!--                                                        <a class="item" href="${child.url!}"--> | ||||
| <!--                                                           target="${child.target!}" title="${child.name!}"><#if child.icon?? && child.icon!=''><i class="m-icon ${child.icon}"></i></#if>${child.name!}</a>--> | ||||
| <!--                                                    </li>--> | ||||
| <!--                                                </#if>--> | ||||
| <!--                                            </#if>--> | ||||
| <!--                                        </#list>--> | ||||
| <!--                                    </nav>--> | ||||
| <!--                                </div>--> | ||||
| <!--                            </#if>--> | ||||
| <!--                        <#else>--> | ||||
| <!--                            <#if menu.name?default('')?starts_with('#hide') != true>--> | ||||
| <!--                                <a class="item" href="${menu.url!}" target="${menu.target!}" title="${menu.name!}"><#if menu.icon?? && menu.icon!=''><i class="m-icon ${menu.icon}"></i></#if>${menu.name!}</a>--> | ||||
| <!--                            </#if>--> | ||||
| <!--                        </#if>--> | ||||
| <!--                    </#list>--> | ||||
| <!--                </@menuTag>--> | ||||
| <!--            </nav>--> | ||||
|             <nav class="navbar-nav active-animate"> | ||||
|                 <th:block th:each="menuItem : ${menuFinder.getPrimary().menuItems}"> | ||||
|                     <a th:if="${#lists.isEmpty(menuItem.children)}" | ||||
|                        class="item" | ||||
|                        th:href="${menuItem.status.href}" | ||||
|                        th:target="${menuItem.spec.target}" | ||||
|                        th:title="${menuItem.status.displayName}"> | ||||
|                         <i th:if="${!#strings.isEmpty(#annotations.getOrDefault(menuItem, 'icon', ''))}" | ||||
|                            th:class="${'m-icon ' + #annotations.getOrDefault(menuItem, 'icon', '')}"></i> | ||||
|                         [[${menuItem.status.displayName}]] | ||||
|                     </a> | ||||
|                     <div th:unless="${#lists.isEmpty(menuItem.children)}" class="item-dropdown" trigger="hover" placement="60px"> | ||||
|                         <div class="item-dropdown-link"> | ||||
|                             <a class="item" | ||||
|                                th:href="${#annotations.getOrDefault(menuItem.status, 'href', 'javascript:')}" | ||||
|                                th:target="${menuItem.spec.target}" | ||||
|                                th:title="${menuItem.status.displayName}"> | ||||
|                                 <i th:if="${!#strings.isEmpty(#annotations.getOrDefault(menuItem, 'icon', ''))}" | ||||
|                                    th:class="${'m-icon ' + #annotations.getOrDefault(menuItem, 'icon', '')}"></i> | ||||
|                                 [[${menuItem.status.displayName}]] | ||||
|                             </a> | ||||
|                             <i class="fa fa-angle-down item-dropdown-link-icon" style="color:var(--main)"></i> | ||||
|                         </div> | ||||
|                         <nav class="item-dropdown-menu"> | ||||
|                             <li th:each="dropdown : ${menuItem.children}" class="item-sub-li"> | ||||
|                                 <a class="item" | ||||
|                                    th:href="${#annotations.getOrDefault(dropdown.status, 'href', 'javascript:')}" | ||||
|                                    th:target="${dropdown.spec.target}" | ||||
|                                    th:title="${dropdown.status.displayName}"> | ||||
|                                     <i th:if="${!#strings.isEmpty(#annotations.getOrDefault(dropdown, 'icon', ''))}" | ||||
|                                        th:class="${'m-icon ' + #annotations.getOrDefault(dropdown, 'icon', '')}"></i> | ||||
|                                     [[${dropdown.status.displayName}]] | ||||
|                                 </a> | ||||
|                                 <ol class="item-sub" th:if="${!#lists.isEmpty(dropdown.children)}"> | ||||
|                                     <li th:each="dropdownChild : ${dropdown.children}"> | ||||
|                                         <a class="item" | ||||
|                                            th:href="${dropdownChild.status.href}" | ||||
|                                            th:target="${dropdownChild.spec.target}" | ||||
|                                            th:title="${dropdownChild.status.displayName}"> | ||||
|                                             <i th:if="${!#strings.isEmpty(#annotations.getOrDefault(dropdownChild, 'icon', ''))}" | ||||
|                                                th:class="${'m-icon ' + #annotations.getOrDefault(dropdownChild, 'icon', '')}"></i> | ||||
|                                             [[${dropdownChild.status.displayName}]] | ||||
|                                         </a> | ||||
|                                     </li> | ||||
|                                 </ol> | ||||
|                             </li> | ||||
|                         </nav> | ||||
|                     </div> | ||||
|                 </th:block> | ||||
|             </nav> | ||||
| 
 | ||||
| <!--            <form data-pjax class="navbar-search" method="get" action="/search">--> | ||||
| <!--                <input maxlength="16" autocomplete="off" placeholder="搜索内容..." name="keyword" value class="input" type="text">--> | ||||
|  | ||||
| @ -1,21 +1,21 @@ | ||||
| <#macro widget position> | ||||
| <aside class="column column-side column-${position} ${settings[position+'_sidebar_sticky']!'none'}-sticky"> | ||||
|     <#assign sidebar_list=[]> | ||||
|     <#list settings?keys as key> | ||||
|         <#if key?index_of('sidebar_priority_') != -1> | ||||
|             <#assign property = "sidebar_" + key?substring(17)> | ||||
|             <#if settings[property]?? && settings[property] == position> | ||||
|                 <#assign priority = settings[key]!'0'?number> | ||||
|                 <#assign sidebar_list=sidebar_list + [{"property": "${key?substring(17)}", "priority": "${priority}"}]> | ||||
|             </#if> | ||||
|         </#if> | ||||
|     </#list> | ||||
|     <#list sidebar_list?sort_by('priority')?reverse as sidebar> | ||||
|         <#include "../widget/${sidebar.property}.ftl"> | ||||
|     </#list> | ||||
|     <#if position == 'left'> | ||||
|         <div class="column-right-shadow is-hidden-desktop"> | ||||
|         </div> | ||||
|     </#if> | ||||
| <aside xmlns:th="https://www.thymeleaf.org" | ||||
|        th:fragment="widget (position)" | ||||
|        class="column column-side column-${position} ${settings[position+'_sidebar_sticky']!'none'}-sticky"> | ||||
| <!--    <#assign sidebar_list=[]>--> | ||||
| <!--    <#list settings?keys as key>--> | ||||
| <!--        <#if key?index_of('sidebar_priority_') != -1>--> | ||||
| <!--            <#assign property = "sidebar_" + key?substring(17)>--> | ||||
| <!--            <#if settings[property]?? && settings[property] == position>--> | ||||
| <!--                <#assign priority = settings[key]!'0'?number>--> | ||||
| <!--                <#assign sidebar_list=sidebar_list + [{"property": "${key?substring(17)}", "priority": "${priority}"}]>--> | ||||
| <!--            </#if>--> | ||||
| <!--        </#if>--> | ||||
| <!--    </#list>--> | ||||
| <!--    <#list sidebar_list?sort_by('priority')?reverse as sidebar>--> | ||||
| <!--        <#include "../widget/${sidebar.property}.ftl">--> | ||||
| <!--    </#list>--> | ||||
| <!--    <#if position == 'left'>--> | ||||
| <!--        <div class="column-right-shadow is-hidden-desktop">--> | ||||
| <!--        </div>--> | ||||
| <!--    </#if>--> | ||||
| </aside> | ||||
| </#macro> | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user