Skip to content

Commit 5762a9c

Browse files
committed
fix: optimize the settings of menu icon
1 parent 8e4e1e4 commit 5762a9c

File tree

5 files changed

+32
-16
lines changed

5 files changed

+32
-16
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body:
2020
I made sure I checked
2121
我确认我已经检查过了
2222
options:
23-
- label: I am using Keep version `4.0.7` or later. (使用 Keep `4.0.7` 或更高版本)
23+
- label: I am using Keep version `4.1.0` or later. (使用 Keep `4.1.0` 或更高版本)
2424
required: true
2525
- label: I have already read the [Troubleshooting page of Hexo](https://hexo.io/docs/troubleshooting) and [Keep documents](https://keep-docs.xpoet.cn). (已阅读 [Hexo 故障处理页面](https://hexo.io/docs/troubleshooting) 和 [Keep 文档](https://keep-docs.xpoet.cn))
2626
required: true

.github/ISSUE_TEMPLATE/feature-request.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body:
2020
I made sure I checked
2121
我确认我已经检查过了
2222
options:
23-
- label: I am using Keep version `4.0.7` or later. (使用 Keep `4.0.7` 或更高版本)
23+
- label: I am using Keep version `4.1.0` or later. (使用 Keep `4.1.0` 或更高版本)
2424
required: true
2525
- label: I have already read the [Troubleshooting page of Hexo](https://hexo.io/docs/troubleshooting) and [Keep documents](https://keep-docs.xpoet.cn). (已阅读 [Hexo 故障处理页面](https://hexo.io/docs/troubleshooting) 和 [Keep 文档](https://keep-docs.xpoet.cn))
2626
required: true

.github/ISSUE_TEMPLATE/other.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body:
2020
I made sure I checked
2121
我确认我已经检查过了
2222
options:
23-
- label: I am using Keep version `4.0.7` or later. (使用 Keep `4.0.7` 或更高版本)
23+
- label: I am using Keep version `4.1.0` or later. (使用 Keep `4.1.0` 或更高版本)
2424
required: true
2525
- label: I have already read the [Troubleshooting page of Hexo](https://hexo.io/docs/troubleshooting) and [Keep documents](https://keep-docs.xpoet.cn). (已阅读 [Hexo 故障处理页面](https://hexo.io/docs/troubleshooting) 和 [Keep 文档](https://keep-docs.xpoet.cn))
2626
required: true

layout/_partial/header.ejs

+13-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const { title: bi_title, logo: bi_logo } = theme?.base_info || {}
33
const { enable: s_fs_enable } = theme?.first_screen || {}
44
const { enable: local_search_enable } = theme?.local_search || {}
5-
const h_menu_nav_object = theme?.menu || { Archives: '/archives' }
5+
const h_menu_nav_object = theme?.menu || { archives: '/archives' }
66
%>
77
<header class="header-wrapper<%= s_fs_enable === true && is_home() ? ' transparent-1' : '' %>">
88
@@ -28,12 +28,14 @@ const h_menu_nav_object = theme?.menu || { Archives: '/archives' }
2828
const nav_icon = temp_menu_list[1]?.trim()?.toLowerCase()
2929
%>
3030
<li class="menu-item">
31-
<% if (nav_icon) { %>
32-
<i class="menu-icon <%= nav_icon %>"></i>
33-
<% } %>
3431
<a class="<%- is_current(nav_path) ? 'active' : '' %>"
3532
href="<%- url_for(nav_path) %>"
36-
><%= __(i.toLowerCase()).toUpperCase() %></a>
33+
>
34+
<% if (nav_icon) { %>
35+
<i class="menu-icon <%= nav_icon %>"></i>
36+
<% } %>
37+
<%= __(i.toLowerCase()).toUpperCase() %>
38+
</a>
3739
</li>
3840
<% } %>
3941
<% if (local_search_enable === true) { %>
@@ -56,15 +58,14 @@ const h_menu_nav_object = theme?.menu || { Archives: '/archives' }
5658
5759
<div class="header-drawer">
5860
<ul class="drawer-menu-list">
59-
<li class="drawer-menu-item flex-center">
60-
<a class="<%- is_home() ? 'active' : '' %>"
61-
href="<%- url_for('/') %>"
62-
><%= __('home').toUpperCase() %></a>
63-
</li>
6461
<% for (let i in h_menu_nav_object) { %>
62+
<%
63+
const temp_menu_list2 = h_menu_nav_object[i]?.split('||')
64+
const nav_path2 = temp_menu_list2[0]?.trim()?.toLowerCase()
65+
%>
6566
<li class="drawer-menu-item flex-center">
66-
<a class="<%- is_current(h_menu_nav_object[i]) ? 'active' : '' %>"
67-
href="<%- url_for(h_menu_nav_object[i]) %>"
67+
<a class="<%- is_current(nav_path2) ? 'active' : '' %>"
68+
href="<%- url_for(nav_path2) %>"
6869
><%= __(i.toLowerCase()).toUpperCase() %></a>
6970
</li>
7071
<% } %>

source/css/layout/_partial/header.styl

+16-1
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,23 @@ $logo-image-box-width = 2.68rem
193193
.menu-icon {
194194
display var(--header-menu-icon)
195195
margin-right 0.1rem
196-
color var(--text-color-3)
197196
}
198197

199198
.is-home & {
200199
if (hexo-config('first_screen') && hexo-config('first_screen.enable') == true) {
201200
a {
202201
color var(--first-screen-header-font-color-light)
203202

203+
.menu-icon {
204+
color var(--first-screen-header-font-color-light)
205+
}
206+
204207
&:hover {
205208
color var(--primary-color)
209+
210+
.menu-icon {
211+
color var(--primary-color)
212+
}
206213
}
207214
}
208215

@@ -216,8 +223,16 @@ $logo-image-box-width = 2.68rem
216223
a {
217224
color var(--first-screen-header-font-color-dark)
218225

226+
.menu-icon {
227+
color var(--first-screen-header-font-color-dark)
228+
}
229+
219230
&:hover {
220231
color var(--primary-color)
232+
233+
.menu-icon {
234+
color var(--primary-color)
235+
}
221236
}
222237
}
223238

0 commit comments

Comments
 (0)