Skip to content

Commit

Permalink
Fallback to relative path for title and navigation title
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Dec 3, 2024
1 parent fada00e commit 754686a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/docset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ toc:
children:
- folder: content
- file: index.md
- file: test.md

Check failure on line 48 in docs/source/docset.yml

View workflow job for this annotation

GitHub Actions / docs

File '/github/workspace/docs/source/nested/test.md' does not exist
- folder: versioning
5 changes: 5 additions & 0 deletions src/Elastic.Markdown/IO/MarkdownFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ private void ReadDocumentInstructions(MarkdownDocument document)
Title = YamlFrontMatter.Title;
NavigationTitle = YamlFrontMatter.NavigationTitle;
}
else
{
Title = RelativePath;
NavigationTitle = RelativePath;
}

var contents = document
.Where(block => block is HeadingBlock { Level: 2 })
Expand Down
2 changes: 2 additions & 0 deletions src/docs-builder/Http/ReloadGeneratorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ private void OnChanged(object sender, FileSystemEventArgs e)

if (e.FullPath.EndsWith("docset.yml"))
Reload();
if (e.FullPath.EndsWith(".md"))
Reload();

Logger.LogInformation($"Changed: {e.FullPath}");
}
Expand Down

0 comments on commit 754686a

Please sign in to comment.