diff options
author | weru <onewesh@gmail.com> | 2020-10-06 15:28:11 +0300 |
---|---|---|
committer | weru <onewesh@gmail.com> | 2020-10-06 15:28:11 +0300 |
commit | 2d7ab2bbc6a315838de02815d747640e0de51b18 (patch) | |
tree | 5027c7e54721bc65fe603dd9190cc22d0281aab0 /layouts | |
parent | e349ad6aac5c17bfc91b452219cb2925840a4e7c (diff) |
update
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/nav.html | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 02a1594..7f47156 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -22,9 +22,11 @@ {{- with .Page }} {{- $active = or $active ( $.IsDescendant .) }} {{- end }} - {{- $url := urls.Parse .URL }} - {{- $baseurl := $.Site.BaseURL }} - <a class="nav-link{{if $active }} active{{end}}" href="{{ with .Page }}{{ $baseurl }}{{ .Permalink }}{{ else }}{{ $baseurl }}{{ .URL }}{{ end }}"><span{{if $active }} class="active"{{end}}>{{ .Name }}</span></a> + {{- $url := absURL .URL }} + {{- if or (hasPrefix .URL "http") (hasPrefix .URL "www.") }} + {{- $url = .URL }} + {{- end }} + <a class="nav-link{{if $active }} active{{end}}" href="{{ $url }}"><span{{if $active }} class="active"{{end}}>{{ .Name }}</span></a> </li> {{- end }} {{ $repo := .Site.Params.source }} |