Skip to content

Commit bd34575

Browse files
authored
Merge pull request #23868 from abpframework/vs-internal-issue-#7423
Refactor TOC generation logic in project index page
2 parents bfb3651 + 31aa2c1 commit bd34575

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -542,12 +542,7 @@ private async Task<bool> TrySetDocumentAsync()
542542
DocumentNameWithExtension = Document.Name;
543543
SetDocumentPageTitle();
544544

545-
if (Document != null && !Document.Content.IsNullOrEmpty())
546-
{
547-
TocItems = _tocGeneratorService.GenerateTocItems(Document.Content, TocLevelCount);
548-
}
549-
550-
await ConvertDocumentContentToHtmlAsync();
545+
await ConvertDocumentContentToHtmlAsync();
551546

552547
return true;
553548
}
@@ -605,6 +600,11 @@ private async Task ConvertDocumentContentToHtmlAsync()
605600
else
606601
{
607602
DocumentNavigationsDto = new DocumentNavigationsDto();
603+
}
604+
605+
if (Document != null && !Document.Content.IsNullOrEmpty())
606+
{
607+
TocItems = _tocGeneratorService.GenerateTocItems(Document.Content, TocLevelCount);
608608
}
609609

610610
var converter = _documentToHtmlConverterFactory.Create<DocumentToHtmlConverterContext>(Document.Format ?? Project.Format);

0 commit comments

Comments
 (0)