From a2f02c6feb7f63a001dd9ef0c2795ae6859add12 Mon Sep 17 00:00:00 2001 From: OkanKoca <137695882+OkanKoca@users.noreply.github.com> Date: Mon, 19 Oct 2026 10:04:35 +0000 Subject: [PATCH 1/4] Truncate docs "In this document" TOC headings with ellipsis Long table-of-contents headings in the docs right panel now stay on one line and end in an ellipsis instead of wrapping or scrolling sideways. The change is CSS only, so the full heading stays in the HTML for search engines, and a title attribute shows it on hover. Co-authored-by: Volobox Agent --- .../Documents/Project/TableOfContents.cshtml | 4 ++-- .../Pages/Documents/Shared/Styles/vs.css | 13 +++++++++++++ .../Pages/Documents/Shared/Styles/vs.scss | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/TableOfContents.cshtml b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/TableOfContents.cshtml index 51a1bbe59c..78fcf168a1 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/TableOfContents.cshtml +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/TableOfContents.cshtml @@ -11,7 +11,7 @@ @foreach (var item in Model) {
  • {2}{3}
  • "; - private const string ListItemAnchor = @"{3}"; + private const string ListItemAnchor = @"{3}"; private const string ListItemSpan = @"{1}"; @@ -157,10 +158,11 @@ namespace Volo.Docs.Areas.Documents.TagHelpers sb.Clear(); var additionalAttributes = node.Keywords.IsNullOrEmpty() ? "" : "data-keywords=\"" + node.Keywords.JoinAsString(",") + "\""; - listInnerItem = string.Format(ListItemAnchor, NormalizePath(node.Path), additionalAttributes ,textCss, + listInnerItem = string.Format(ListItemAnchor, NormalizePath(node.Path), additionalAttributes, textCss, node.Text.IsNullOrEmpty() ? "?" - : sb.Append(node.Text).Append(badgeStringBuilder.ToString()).ToString()); + : sb.Append(node.Text).Append(badgeStringBuilder.ToString()).ToString(), + WebUtility.HtmlEncode(node.Text)); } sb.Clear(); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js index 127a6223d9..da4f12b449 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js @@ -31,6 +31,7 @@ var doc = doc || {}; var dataKeywords = node.keywords ? `data-keywords="${node.keywords}"` : ""; $li.append(` ${node.text}`) + $li.children("a").attr("title", node.text); if(node.isLazyExpandable){ $li.addClass("lazy-expand"); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.css b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.css index f8c00aa1ba..846016ac46 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.css +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.css @@ -356,6 +356,9 @@ body.scrolledMore:has(#abp-chatbot-container) .alert-criteria .options-header .t padding: 4px 0; display: block; border-bottom: 0; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .docs-page .docs-sidebar .docs-tree-list ul li a:hover { color: #fff; diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.scss b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.scss index 42ca8e5c38..79f6e05310 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.scss +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.scss @@ -437,6 +437,10 @@ body { padding: 4px 0; display: block; border-bottom: 0; + // Truncate long titles visually; the full text stays in the HTML. + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; &:hover { color: #fff;