From fa0fb08711f0deef3a0255fd9db7570836344f53 Mon Sep 17 00:00:00 2001 From: honurbu Date: Tue, 6 Feb 2024 13:46:53 +0300 Subject: [PATCH] Case Sensivity Added --- .../Pages/Documents/Project/Index.cshtml.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index 141fa337c4..a1bf656301 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -117,9 +117,16 @@ namespace Volo.Docs.Pages.Documents.Project { return Redirect(decodedUrl); } - var documentNameFallback = DocumentName ?? ""; + var documentPath = DocumentName ?? ""; - var documentNames = new[] { DocumentName, documentNameFallback.EnsureEndsWith('/') + "Index", documentNameFallback.EnsureEndsWith('/') + "index" }; + string[] documentNames; + + if (displayUrl.EndsWith("/index", StringComparison.OrdinalIgnoreCase)) + { + documentPath = documentPath.Substring(0, documentPath.LastIndexOf('/') + 1); + } + + documentNames = new[] { DocumentName, documentPath.EnsureEndsWith('/') + "Index", documentPath.EnsureEndsWith('/') + "index" }; foreach (var documentName in documentNames) {