Skip to content

Commit

Permalink
fix: optimize the settings of menu icon
Browse files Browse the repository at this point in the history
  • Loading branch information
XPoet committed Mar 6, 2024
1 parent 8e4e1e4 commit 5762a9c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
I made sure I checked
我确认我已经检查过了
options:
- label: I am using Keep version `4.0.7` or later. (使用 Keep `4.0.7` 或更高版本)
- label: I am using Keep version `4.1.0` or later. (使用 Keep `4.1.0` 或更高版本)
required: true
- 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))
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
I made sure I checked
我确认我已经检查过了
options:
- label: I am using Keep version `4.0.7` or later. (使用 Keep `4.0.7` 或更高版本)
- label: I am using Keep version `4.1.0` or later. (使用 Keep `4.1.0` 或更高版本)
required: true
- 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))
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
I made sure I checked
我确认我已经检查过了
options:
- label: I am using Keep version `4.0.7` or later. (使用 Keep `4.0.7` 或更高版本)
- label: I am using Keep version `4.1.0` or later. (使用 Keep `4.1.0` 或更高版本)
required: true
- 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))
required: true
Expand Down
25 changes: 13 additions & 12 deletions layout/_partial/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const { title: bi_title, logo: bi_logo } = theme?.base_info || {}
const { enable: s_fs_enable } = theme?.first_screen || {}
const { enable: local_search_enable } = theme?.local_search || {}
const h_menu_nav_object = theme?.menu || { Archives: '/archives' }
const h_menu_nav_object = theme?.menu || { archives: '/archives' }
%>
<header class="header-wrapper<%= s_fs_enable === true && is_home() ? ' transparent-1' : '' %>">
Expand All @@ -28,12 +28,14 @@ const h_menu_nav_object = theme?.menu || { Archives: '/archives' }
const nav_icon = temp_menu_list[1]?.trim()?.toLowerCase()
%>
<li class="menu-item">
<% if (nav_icon) { %>
<i class="menu-icon <%= nav_icon %>"></i>
<% } %>
<a class="<%- is_current(nav_path) ? 'active' : '' %>"
href="<%- url_for(nav_path) %>"
><%= __(i.toLowerCase()).toUpperCase() %></a>
>
<% if (nav_icon) { %>
<i class="menu-icon <%= nav_icon %>"></i>
<% } %>
<%= __(i.toLowerCase()).toUpperCase() %>
</a>
</li>
<% } %>
<% if (local_search_enable === true) { %>
Expand All @@ -56,15 +58,14 @@ const h_menu_nav_object = theme?.menu || { Archives: '/archives' }
<div class="header-drawer">
<ul class="drawer-menu-list">
<li class="drawer-menu-item flex-center">
<a class="<%- is_home() ? 'active' : '' %>"
href="<%- url_for('/') %>"
><%= __('home').toUpperCase() %></a>
</li>
<% for (let i in h_menu_nav_object) { %>
<%
const temp_menu_list2 = h_menu_nav_object[i]?.split('||')
const nav_path2 = temp_menu_list2[0]?.trim()?.toLowerCase()
%>
<li class="drawer-menu-item flex-center">
<a class="<%- is_current(h_menu_nav_object[i]) ? 'active' : '' %>"
href="<%- url_for(h_menu_nav_object[i]) %>"
<a class="<%- is_current(nav_path2) ? 'active' : '' %>"
href="<%- url_for(nav_path2) %>"
><%= __(i.toLowerCase()).toUpperCase() %></a>
</li>
<% } %>
Expand Down
17 changes: 16 additions & 1 deletion source/css/layout/_partial/header.styl
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,23 @@ $logo-image-box-width = 2.68rem
.menu-icon {
display var(--header-menu-icon)
margin-right 0.1rem
color var(--text-color-3)
}

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

.menu-icon {
color var(--first-screen-header-font-color-light)
}

&:hover {
color var(--primary-color)

.menu-icon {
color var(--primary-color)
}
}
}

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

.menu-icon {
color var(--first-screen-header-font-color-dark)
}

&:hover {
color var(--primary-color)

.menu-icon {
color var(--primary-color)
}
}
}

Expand Down

0 comments on commit 5762a9c

Please sign in to comment.