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