Skip to content

Commit f4904ef

Browse files
committed
Allow TOC references from narrative repository without requiring path_prefix.
1 parent dddf0e4 commit f4904ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Elastic.Documentation.Navigation/Assembler/AssembledNavigation.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5+
using Elastic.Documentation.Configuration.Assembler;
56
using Elastic.Documentation.Configuration.DocSet;
67
using Elastic.Documentation.Extensions;
78
using Elastic.Documentation.Navigation.Isolated;
@@ -116,7 +117,10 @@ IDocumentationContext context
116117
// Validate that path_prefix is set
117118
if (string.IsNullOrWhiteSpace(pathPrefix))
118119
{
119-
context.EmitError(context.ConfigurationPath, $"path_prefix is required for TOC reference: {tocRef.Source}");
120+
// we allow not setting path prefixes for toc references from the narrative repository
121+
if (tocRef.Source.Scheme != NarrativeRepository.RepositoryName)
122+
context.EmitError(context.ConfigurationPath, $"path_prefix is required for TOC reference: {tocRef.Source}");
123+
120124
pathPrefix = tocRef.Source.Scheme;
121125
if (!string.IsNullOrEmpty(tocRef.Source.Host))
122126
pathPrefix += $"/{tocRef.Source.Host}";

0 commit comments

Comments
 (0)