diff --git a/layouts/partials/components/sidebar/collapsible-button.html b/layouts/partials/components/sidebar/collapsible-button.html new file mode 100644 index 0000000..3ba74f3 --- /dev/null +++ b/layouts/partials/components/sidebar/collapsible-button.html @@ -0,0 +1,5 @@ + + + + + diff --git a/layouts/partials/components/sidebar/footer.html b/layouts/partials/components/sidebar/footer.html new file mode 100644 index 0000000..40871bd --- /dev/null +++ b/layouts/partials/components/sidebar/footer.html @@ -0,0 +1,12 @@ +{{- range site.Menus.sidebar }} + {{- $name := or (T .Identifier) .Name }} + {{- if eq .Params.type "separator" }} +
  • + {{ $name }} +
  • + {{- else }} +
  • + {{- partial "components/sidebar/item-link" (dict "active" false "title" $name "link" (.URL | relLangURL)) -}} +
  • + {{- end }} +{{- end -}} diff --git a/layouts/partials/components/sidebar/item-link.html b/layouts/partials/components/sidebar/item-link.html new file mode 100644 index 0000000..ea7396e --- /dev/null +++ b/layouts/partials/components/sidebar/item-link.html @@ -0,0 +1,18 @@ +{{- $external := strings.HasPrefix .link "http" -}} + + {{- .title -}} + {{- with .context }} + {{- if or .RegularPages .Sections }} + {{- partialCached "components/sidebar/collapsible-button" . }} + {{- end }} + {{ end -}} + diff --git a/layouts/partials/sidebar-ng.html b/layouts/partials/sidebar-ng.html index 0859002..8eeed1a 100644 --- a/layouts/partials/sidebar-ng.html +++ b/layouts/partials/sidebar-ng.html @@ -27,6 +27,7 @@ {{ warnf "The data file for the sidebar is still unstable. Please use caution when upgrading." }}
    {{ . | jsonify (dict "indent" "  ") }}
    {{ end }} + {{ partialCached "components/sidebar/footer" $context site.Home }}