diff --git a/layouts/partials/assets/navbar-item.html b/layouts/partials/assets/navbar-item.html index 865c9f9a..002e2f93 100644 --- a/layouts/partials/assets/navbar-item.html +++ b/layouts/partials/assets/navbar-item.html @@ -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 -}} diff --git a/package-lock.json b/package-lock.json index c765660a..10181198 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gethinode/hinode", - "version": "0.24.0", + "version": "0.24.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gethinode/hinode", - "version": "0.24.0", + "version": "0.24.1", "license": "MIT", "dependencies": { "@fullhuman/postcss-purgecss": "^6.0.0", diff --git a/package.json b/package.json index 60c8bda0..aa94e3fe 100644 --- a/package.json +++ b/package.json @@ -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",