Skip to content

Commit

Permalink
feat: add param to empty sidebar on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
davlgd committed Feb 12, 2024
1 parent 716af59 commit f922d90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions exampleSite/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ params:
# full (100%), wide (90rem), normal (1280px)
width: normal

sidebar:
emptyMobile: false

theme:
# light | dark | system
default: system
Expand Down
2 changes: 2 additions & 0 deletions layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
{{ partial "search.html" }}
</div>
<div class="hextra-scrollbar overflow-y-auto overflow-x-hidden p-4 grow md:h-[calc(100vh-var(--navbar-height)-var(--menu-height))]">
{{- if not site.Params.sidebar.emptyMobile -}}
<ul class="flex flex-col gap-1 md:hidden">
<!-- Nav -->
{{ template "sidebar-main" (dict "context" site.Home "pageURL" $pageURL "page" $context "toc" true) -}}
{{ template "sidebar-footer" }}
</ul>
{{- end -}}

<!-- Sidebar on large screen -->
{{- if $disableSidebar -}}
Expand Down

0 comments on commit f922d90

Please sign in to comment.