Page.URL -> Page.Permalink due to deprecation warning

This commit is contained in:
bedefaced 2021-09-02 15:51:40 +03:00
parent 1bed6f5dd2
commit 696e69ea5a
2 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@
{{ $currentPage := . }} {{ $currentPage := . }}
{{ $pageName := "" }} {{ $pageName := "" }}
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
{{ if eq ($currentPage.URL | absLangURL) (.URL | absLangURL) }} {{ if eq ($currentPage.Permalink) (.URL | absLangURL) }}
{{ $pageName = .Name }} {{ $pageName = .Name }}
{{ end }} {{ end }}
{{ end }} {{ end }}
@ -18,7 +18,7 @@
{{ if eq $pageLang .Lang }} {{ if eq $pageLang .Lang }}
<br/><span class="active">$ echo $LANG<br/><b>{{ .LanguageName }}</b></span><br/> <br/><span class="active">$ echo $LANG<br/><b>{{ .LanguageName }}</b></span><br/>
{{ else }} {{ else }}
<br/><a href="{{ $translation.URL }}">export LANG={{ .LanguageName }}; ./{{ $pageName }}</a><br/> <br/><a href="{{ $translation.Permalink }}">export LANG={{ .LanguageName }}; ./{{ $pageName }}</a><br/>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }}

View file

@ -3,7 +3,7 @@
<ul> <ul>
{{ $currentPage := . }} {{ $currentPage := . }}
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
<li class="main-nav__item"><a class="nav-main-item{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) (eq ($currentPage.URL | absLangURL) (.URL | absLangURL)) }} active{{end}}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a></li> <li class="main-nav__item"><a class="nav-main-item{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) (eq ($currentPage.Permalink) (.URL | absLangURL)) }} active{{end}}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a></li>
{{ end }} {{ end }}
</ul> </ul>
</nav> </nav>