diff --git a/layouts/partials/sidebar-tree.html b/layouts/partials/sidebar-tree.html
index 2ce0c5637..3d3b2b27b 100644
--- a/layouts/partials/sidebar-tree.html
+++ b/layouts/partials/sidebar-tree.html
@@ -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 -}}
@@ -71,4 +72,4 @@
{{- end }}
-{{- end }}
\ No newline at end of file
+{{- end }}