Skip to content

Commit

Permalink
Merge pull request #1047 from gethinode/develop
Browse files Browse the repository at this point in the history
Suppress undefined navbar links
  • Loading branch information
markdumay authored Jul 23, 2024
2 parents 884da31 + f25fbb3 commit b944d81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions layouts/partials/assets/navbar-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{{- $menuURL := "" -}}
{{ if or (strings.HasPrefix $menu.PageRef "http") (strings.HasPrefix $menu.URL "http") }}
{{ $menuURL = or $menu.PageRef $menu.URL }}
{{ else }}
{{ else if (or $menu.PageRef $menu.URL) }}
{{- $menuURL = urls.JoinPath $baseURL ((or $menu.PageRef $menu.URL) | relLangURL) -}}
{{ end }}
{{- $pageURL := $page.RelPermalink -}}
Expand All @@ -47,7 +47,7 @@
{{- if $cue -}}
{{ $suffix = partial "assets/icon.html" (dict "icon" "fas up-right-from-square fa-2xs") }}
{{- end -}}
{{ else }}
{{ else if $menuURL }}
{{ $ref := partial "utilities/GetPage.html" (dict "url" $url.Path "page" $page) }}
{{- if not $ref -}}
{{- warnf "partial [assets/navbar-item.html] - Cannot find page of menu item '%s': %s" $menu.Name $url -}}
Expand Down Expand Up @@ -87,7 +87,7 @@
<a class="{{ $anchorClass }}{{ if $isActive }} active{{ end }}{{ with $class }} {{ . }}{{ end }}"
{{ if $isIcon }}aria-label="{{ $menu.Name }}"{{ end }}
data-nav="main" data-nav-main="{{ $mainNav }}"{{ with $childNav }} data-nav-child="{{ . }}"{{ end }}
href="{{ $menuURL }}{{ $params | safeHTMLAttr }}"{{ with $externalHref }} {{ . | safeHTMLAttr }}{{ end }} {{ $button | safeHTMLAttr }}>
{{ if $menuURL }} href="{{ $menuURL }}{{ $params | safeHTMLAttr }}"{{ with $externalHref }} {{ . | safeHTMLAttr }}{{ end }}{{ end }} {{ $button | safeHTMLAttr }}>

{{- with $menu.Pre }}
{{ if hasPrefix . "<i" }}
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.17",
"version": "0.24.18",
"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 b944d81

Please sign in to comment.