Skip to content

Commit b2798f9

Browse files
committed
Ensure documentationset passes path prefix to documentationsetnavigation
1 parent c08ac2d commit b2798f9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ public DocumentationSetNavigation(
4444
IDocumentationFileFactory<TModel> factory,
4545
IRootNavigationItem<INavigationModel, INavigationItem>? parent = null,
4646
IRootNavigationItem<INavigationModel, INavigationItem>? root = null,
47-
IPathPrefixProvider? pathPrefixProvider = null
47+
string? pathPrefix = null
4848
)
4949
{
5050
_factory = factory;
51+
_pathPrefix = pathPrefix ?? string.Empty;
5152
// Initialize root properties
5253
NavigationRoot = root ?? this;
5354
Parent = parent;
5455
Depth = 0;
5556
Hidden = false;
5657
IsCrossLink = false;
57-
PathPrefixProvider = pathPrefixProvider ?? this;
58-
_pathPrefix = pathPrefixProvider?.PathPrefix ?? string.Empty;
58+
PathPrefixProvider = this;
5959
Id = ShortId.Create(documentationSet.Project ?? "root");
6060
IsUsingNavigationDropdown = documentationSet.Features.PrimaryNav ?? false;
6161
Git = context.Git;

src/Elastic.Markdown/IO/DocumentationSet.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections.Concurrent;
66
using System.Collections.Frozen;
77
using System.IO.Abstractions;
8+
using System.Net.Mime;
89
using System.Runtime.CompilerServices;
910
using System.Runtime.InteropServices;
1011
using Elastic.Documentation;
@@ -74,7 +75,7 @@ ICrossLinkResolver linkResolver
7475
MarkdownParser = new MarkdownParser(context, resolver);
7576

7677
var fileFactory = new MarkdownFileFactory(context, MarkdownParser, EnabledExtensions);
77-
Navigation = new DocumentationSetNavigation<MarkdownFile>(context.ConfigurationYaml, context, fileFactory);
78+
Navigation = new DocumentationSetNavigation<MarkdownFile>(context.ConfigurationYaml, context, fileFactory, pathPrefix: context.UrlPathPrefix);
7879

7980
Name = Context.Git != GitCheckoutInformation.Unavailable
8081
? Context.Git.RepositoryName

0 commit comments

Comments
 (0)