Skip to content

Commit

Permalink
Improve warning msg, clean up whitespace excess
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Aug 7, 2024
1 parent c262d5d commit 43549ca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions layouts/partials/sidebar-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
{{ $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 -}}
{{ $truncatedEntryCount := sub (len $pages_tmp) $sidebarMenuTruncate -}}
{{ if gt $truncatedEntryCount 0 -}}
{{ warnf "WARNING: %d sidebar entries have been truncated. To avoid this, increase `params.ui.sidebar_menu_truncate` to at least %d (from %d) in your config file. Section: %s"
$truncatedEntryCount (len $pages_tmp) $sidebarMenuTruncate $s.Path -}}
{{ 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 @@ -72,4 +76,4 @@
</ul>
{{- end }}
</li>
{{- end }}
{{- end -}}

0 comments on commit 43549ca

Please sign in to comment.