Skip to content

Commit 3353d01

Browse files
committed
Fix DocumentationSet.Url for reporting first interesting url
1 parent 4581ca4 commit 3353d01

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

src/Elastic.Documentation.Navigation/Isolated/DocumentationSetNavigation.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,7 @@ public DocumentationSetNavigation(
109109
public Uri Identifier { get; }
110110

111111
/// <inheritdoc />
112-
public string Url
113-
{
114-
get
115-
{
116-
var rootUrl = HomeProvider.PathPrefix.TrimEnd('/');
117-
return string.IsNullOrEmpty(rootUrl) ? "/" : $"{rootUrl}/";
118-
}
119-
}
112+
public string Url => Index.Url;
120113

121114
/// <inheritdoc />
122115
public string NavigationTitle => Index.NavigationTitle;

src/Elastic.Markdown/IO/DocumentationSet.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Collections.Concurrent;
66
using System.Collections.Frozen;
77
using System.IO.Abstractions;
8-
using System.Net.Mime;
98
using System.Runtime.CompilerServices;
109
using System.Runtime.InteropServices;
1110
using Elastic.Documentation;

tests/Navigation.Tests/Isolation/DynamicUrlTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public void UrlRootChangesForTableOfContentsNavigation()
281281
navigation.HomeProvider = new NavigationHomeProvider("/v2", navigation.NavigationRoot);
282282

283283
// Both TOC and file URLs should update
284-
navigation.Url.Should().Be("/v2/");
284+
navigation.Url.Should().Be("/v2/guides/api/reference/");
285285
toc.Url.Should().Be("/v2/guides/api/reference/");
286286
file.Url.Should().Be("/v2/guides/api/reference/");
287287
}

0 commit comments

Comments
 (0)