Skip to content

Commit

Permalink
Adds a warning when truncating menu list in sidebar-tree.html
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Aug 7, 2024
1 parent 13dc291 commit c262d5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion layouts/partials/sidebar-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
{{ $mid := printf "m-%s" ($s.RelPermalink | anchorize) -}}
{{ $pages_tmp := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true -}}
{{ $pages := $pages_tmp | first $sidebarMenuTruncate -}}
{{ if ge (len $pages_tmp) $sidebarMenuTruncate -}}{{ warnf "Warning: Some ToC entries won't be displayed on %s. Increase [params.ui.sidebar_menu_truncate] in your config file to avoid that. " $s -}}{{ end -}}
{{ $withChild := gt (len $pages) 0 -}}
{{ $manualLink := cond (isset $s.Params "manuallink") $s.Params.manualLink ( cond (isset $s.Params "manuallinkrelref") (relref $s $s.Params.manualLinkRelref) $s.RelPermalink) -}}
{{ $manualLinkTitle := cond (isset $s.Params "manuallinktitle") $s.Params.manualLinkTitle $s.Title -}}
Expand All @@ -71,4 +72,4 @@
</ul>
{{- end }}
</li>
{{- end }}
{{- end }}

0 comments on commit c262d5d

Please sign in to comment.