Skip to content

Commit

Permalink
Merge pull request #1269 from gethinode/develop
Browse files Browse the repository at this point in the history
Fix link cleaning and navbar menu check
  • Loading branch information
markdumay authored Oct 25, 2024
2 parents bba9629 + d0410af commit a746fd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion layouts/partials/assets/link.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
{{ if not $u.Scheme }}
{{ $b := urls.Parse site.BaseURL }}
{{ $destination = strings.TrimPrefix $b.Path $destination }}
{{ $destination = path.Clean $destination }}
{{ else }}
{{ $destination = (strings.TrimPrefix (strings.TrimSuffix "/" site.BaseURL) $destination) }}
{{ end }}
{{ $destination = path.Clean $destination }}
{{ if not $destination }}{{ $destination = "/" }}{{ end }}

{{- $target := "" -}}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/assets/navbar-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"size" "sm"
)}}
{{ else }}
{{ cond $menuURL "<a" "<div" | safeHTML }} class="{{ $anchorClass }}{{ if $isActive }} active{{ end }}{{ with $class }} {{ . }}{{ end }}"
{{ cond (ne $menuURL "") "<a" "<div" | safeHTML }} 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 }}
{{ if $menuURL }} href="{{ $menuURL }}{{ $params | safeHTML }}"{{ with $externalHref }} {{ . | safeHTML }}{{ end }}{{ end }} {{ $button | safeHTML }}>
Expand All @@ -100,6 +100,6 @@
<span {{ if $isActive }} class="active"{{ end }}>{{ if or (not $isIcon) $plain }}{{ $menu.Name }}{{ end }}</span>
{{- with $menu.Post }}{{ . }}{{ end -}}
{{- if not $isIcon }}&nbsp;{{ $suffix }}{{ end -}}
{{ cond $menuURL "</a>" "</div>" | safeHTML }}
{{ cond (ne $menuURL "") "</a>" "</div>" | safeHTML }}
{{ end }}
{{ end }}

0 comments on commit a746fd1

Please sign in to comment.