EvanNotFound / hexo-theme-redefine

Simplicity in Speed, Purity in Design. Redefine Your Hexo Journey.
https://redefine.ohevan.com
GNU General Public License v3.0
1.41k stars 116 forks source link

[功能建议]:手机模式下查看博客时没有侧边栏的菜单,希望添加; #331

Closed viEcho closed 7 months ago

viEcho commented 8 months ago

功能描述

希望手机模式下查看时有侧边栏的菜单,目前我看是没有添加的

图片描述

以下是我的导航栏和侧边栏

导航栏 侧边栏

以下是手机模式下看到的原菜单及我调整后的菜单

old new

以下是我个人修改的代码: 在navbar.ejs 下的ul标签底端,简单粗暴的添加的一段代码(当然我这里侧边栏是默认不加子目录的,个人认为侧边栏还加子栏目太丑了,当然如果有这样做的,下面的代码得按照导航栏的写法改正后使用):

<!--手机模式下增加侧边栏的导航-->
          <% if (theme.home.sidebar.links !== null) {%>
              <% for (let j in theme.home.sidebar.links) { %>
                  <li class="drawer-navbar-item text-base my-1.5 flex flex-col w-full">
                      <a class="py-1.5 px-2 flex flex-row items-center justify-between gap-1 hover:!text-primary active:!text-primary text-2xl font-semibold group border-b border-border-color hover:border-primary w-full active"
                          href="<%= url_for(theme.home.sidebar.links[j].path) %>"
                       >
                          <span><%= __(j) %></span>
                          <i class="<%= theme.home.sidebar.links[j].icon %> fa-sm fa-fw"></i>
                       </a>
                  </li>
              <% } %>
          <% } %>

其他

个人已按上面修改了源代码简单实现,希望博主能结合美观实用的角度考虑下这个提议;另外提一嘴,查看分类及归档的文章时,所有的a标签都是原页面打开,希望能改成新页面打开;

EvanNotFound commented 8 months ago

lgtm

bianyukun1213 commented 8 months ago

可否把此行为作为可选项添加到配置文件中?

EvanNotFound commented 8 months ago

可以

EvanNotFound commented 7 months ago

已在 Redefine v2.6.1 版本添加,请前往 https://github.com/EvanNotFound/hexo-theme-redefine/releases 查看并更新主题