🐛 Fixed menu active action match error item that it could not use cached function.

This commit is contained in:
凡梦星尘 2022-09-18 09:00:00 +08:00
parent f1fafdc587
commit 56166c7e76
3 changed files with 2 additions and 15 deletions

View File

@ -17,7 +17,7 @@
<main class="main">
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner">
{{- partialCached "header.html" . }}
{{- partial "header.html" . }}
</div>
<!-- Sidebar -->
{{- if ne .Site.Params.sidebar.display "remove" }}

View File

@ -1,3 +1,2 @@
{{ $paginator := .Paginator.Pages.GroupByDate "2006" }}
{{ partial "list.html" $paginator }}

View File

@ -1,12 +0,0 @@
<ul class="main-menu menu">
{{- $curP := . }}
{{- range .Site.Menus.main }}
{{ $active := or ($curP.IsMenuCurrent "main" .) ($curP.HasMenuCurrent "main" .) }}
{{ $active = or $active (eq .URL "/")}}
<li class="menu-item menu-item-{{ .Identifier }}">
<a href="{{ .URL }}" class="hvr-icon-pulse{{if $active }} menu-item-active{{ end }}" rel="section">
<i class="fa fa-{{ .Pre }} hvr-icon"></i>{{- .Name }}
</a>
</li>
{{- end }}
</ul>