refactor: use "sidebar-tree" for entire rendering

chore: update example site content

chore: add configuration for footer

chore: allow disable footer completely

chore: navbar highlights if contains current page

chore: styling update for partial templates

chore: update steps to use markdown delimiter
This commit is contained in:
Xin
2023-08-14 21:56:26 +01:00
parent 7a2cca9181
commit ed14432f77
15 changed files with 178 additions and 140 deletions

View File

@ -5,36 +5,39 @@
<a class="flex items-center hover:opacity-75 ltr:mr-auto rtl:ml-auto" href="{{ .Site.Home.RelPermalink }}">
{{ partial "utils/icon.html" (dict "name" "hextra" "attributes" "height=20") }}
<span class="mx-2 font-extrabold hidden md:inline select-none" title="{{ .Site.Title }}">
{{ .Site.Title }}
{{- .Site.Title -}}
</span>
</a>
{{- $currentPage := . -}}
{{- range .Site.Menus.main -}}
{{- if eq .Params.type "search" -}}
{{ partial "search.html" (dict "params" .Params) }}
{{- partial "search.html" (dict "params" .Params) -}}
{{- else -}}
{{ $external := strings.HasPrefix .URL "http" }}
{{- $external := strings.HasPrefix .URL "http" -}}
{{/* Display icon menu item */}}
{{- if .Params.icon -}}
<a class="p-2 text-current" {{ if $external }}target="_blank" rel="noreferer"{{ end }} href="{{ .URL | safeURL }}">
{{ partial "utils/icon.html" (dict "name" .Params.icon "attributes" "height=24") }}
{{- partial "utils/icon.html" (dict "name" .Params.icon "attributes" "height=24") -}}
<span class="sr-only">{{ .Name }}</span>
</a>
{{- else -}}
{{- $active := or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .) -}}
{{- $activeClass := cond $active "font-medium" "text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200" -}}
<a
href="{{ .URL | safeURL }}"
{{ if $external }}target="_blank" rel="noreferer"{{ end }}
class="text-sm contrast-more:text-gray-700 contrast-more:dark:text-gray-100 relative -ml-2 hidden whitespace-nowrap p-2 md:inline-block text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200"
class="text-sm contrast-more:text-gray-700 contrast-more:dark:text-gray-100 relative -ml-2 hidden whitespace-nowrap p-2 md:inline-block {{ $activeClass }}"
>
<span class="text-center">{{ .Name }}</span>
</a>
{{- end -}}
{{ end }}
{{ end }}
{{- end -}}
{{- end -}}
<button type="button" aria-label="Menu" class="hamburger-menu -mr-2 rounded p-2 active:bg-gray-400/20 md:hidden">
{{ partial "utils/icon.html" (dict "name" "menu" "attributes" "height=24") }}
{{- partial "utils/icon.html" (dict "name" "menu" "attributes" "height=24") -}}
</button>
</nav>
</div>