Skip to content

Commit 410960c

Browse files
theletterfMpdreamz
andauthored
Update src/Elastic.Markdown/Exporters/LlmMarkdownExporter.cs
Co-authored-by: Martijn Laarman <[email protected]>
1 parent 57db0f1 commit 410960c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/Elastic.Markdown/Exporters/LlmMarkdownExporter.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,10 @@ public static string ConvertToLlmMarkdown(MarkdownDocument document, BuildContex
9292

9393
private static bool IsRootIndexFile(MarkdownExportFileContext fileContext)
9494
{
95-
var defaultOutputFile = fileContext.DefaultOutputFile;
96-
var fileName = Path.GetFileNameWithoutExtension(defaultOutputFile.Name);
97-
if (fileName != "index")
98-
return false;
99-
100-
var root = fileContext.BuildContext.OutputDirectory;
101-
return defaultOutputFile.Directory!.FullName == root.FullName;
95+
var fs = fileContext.BuildContext.ReadFileSystem;
96+
var expected = fs.FileInfo.New(Path.Combine(fileContext.BuildContext.OutputDirectory.FullName, "index.html"));
97+
return fileContext.DefaultOutputFile.FullName == expected.FullName;
10298
}
103-
10499
private static IFileInfo GetLlmOutputFile(MarkdownExportFileContext fileContext)
105100
{
106101
var source = fileContext.SourceFile.SourceFile;

0 commit comments

Comments
 (0)