forked from drowl87/hextra_mirror
chore: update sidebar item list and link class names
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
{{- $external := strings.HasPrefix .link "http" -}}
|
||||
|
||||
{{- $activeClass := cond (.active) "sidebar-item-active" "sidebar-item-inactive" -}}
|
||||
{{- $activeClass := cond (.active) "active" "inactive" -}}
|
||||
|
||||
|
||||
<a
|
||||
class="sidebar-item {{ $activeClass }} [-webkit-tap-highlight-color:transparent] [-webkit-touch-callout:none] [word-break:break-word]"
|
||||
class="hextra-sidebar-item-link {{ $activeClass }} [-webkit-tap-highlight-color:transparent] [-webkit-touch-callout:none] [word-break:break-word]"
|
||||
href="{{ .link }}"
|
||||
{{ if $external }}target="_blank" rel="noreferer"{{ end }}
|
||||
>
|
||||
|
@ -4,13 +4,13 @@
|
||||
|
||||
|
||||
<div class="ltr:hx-pr-0 hx-overflow-hidden">
|
||||
<ul class="sidebar-item-list-container">
|
||||
<ul class="hextra-sidebar-item-list">
|
||||
{{- range $items }}
|
||||
{{- $active := and (not $cached) (or (eq $pageLink .link) (eq (strings.TrimSuffix "/" $pageLink) .link)) -}}
|
||||
{{- $containsPage := hasPrefix $pageLink .link -}}
|
||||
{{- $shouldOpen := or (.open) $containsPage $active | default false -}}
|
||||
|
||||
<li class="sidebar-item-list hx-flex hx-flex-col {{ if $shouldOpen }}open{{ end }}">
|
||||
<li class="hextra-sidebar-item hx-flex hx-flex-col {{ if $shouldOpen }}open{{ end }}">
|
||||
{{- partial "components/sidebar/item-link" (dict "active" $active "title" .title "link" .link "items" .items) -}}
|
||||
{{- if .items -}}
|
||||
{{- partial "components/sidebar/render-items" (dict "items" .items "link" .link "cached" $cached) -}}
|
||||
|
Reference in New Issue
Block a user