diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index 3254882f7c..319d5f1b63 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/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(Document.Format ?? Project.Format);