Browse Source

Merge pull request #23868 from abpframework/vs-internal-issue-#7423

Refactor TOC generation logic in project index page
pull/23902/head
Yağmur Çelik 10 months ago
committed by GitHub
parent
commit
bd34575f53
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs

12
modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs

@ -542,12 +542,7 @@ namespace Volo.Docs.Pages.Documents.Project
DocumentNameWithExtension = Document.Name;
SetDocumentPageTitle();
if (Document != null && !Document.Content.IsNullOrEmpty())
{
TocItems = _tocGeneratorService.GenerateTocItems(Document.Content, TocLevelCount);
}
await ConvertDocumentContentToHtmlAsync();
await ConvertDocumentContentToHtmlAsync();
return true;
}
@ -605,6 +600,11 @@ namespace Volo.Docs.Pages.Documents.Project
else
{
DocumentNavigationsDto = new DocumentNavigationsDto();
}
if (Document != null && !Document.Content.IsNullOrEmpty())
{
TocItems = _tocGeneratorService.GenerateTocItems(Document.Content, TocLevelCount);
}
var converter = _documentToHtmlConverterFactory.Create<DocumentToHtmlConverterContext>(Document.Format ?? Project.Format);

Loading…
Cancel
Save