Skip to content

Commit

Permalink
Merge pull request #983 from gethinode/develop
Browse files Browse the repository at this point in the history
Fix external links in navbar
  • Loading branch information
markdumay authored Jun 4, 2024
2 parents 2acc8fc + 7ed3313 commit deaf9f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions layouts/partials/assets/navbar-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@
{{- $class := .class -}}
{{- $cue := .cue | default site.Params.main.externalLinks.cue -}}
{{- $tab := .tab | default site.Params.main.externalLinks.tab -}}
{{- $baseURL := $page.Scratch.Get "baseURL" -}}

{{- $menuURL := urls.JoinPath $baseURL ((or $menu.PageRef $menu.URL) | relLangURL) -}}
{{- $baseURL := $page.Scratch.Get "baseURL" | default "/" -}}
{{- $menuURL := "" -}}
{{ if or (strings.HasPrefix $menu.PageRef "http") (strings.HasPrefix $menu.URL "http") }}
{{ $menuURL = or $menu.PageRef $menu.URL }}
{{ else }}
{{- $menuURL = urls.JoinPath $baseURL ((or $menu.PageRef $menu.URL) | relLangURL) -}}
{{ end }}
{{- $pageURL := $page.RelPermalink -}}
{{- $isActive := or (and (hasPrefix $pageURL $menuURL) (ne $menuURL ("/" | relLangURL))) (eq $pageURL $menuURL) -}}
{{- $isAlias := $menu.Params.alias -}}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "0.24.0",
"version": "0.24.1",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",
Expand Down

0 comments on commit deaf9f0

Please sign in to comment.