diff --git a/src/Elastic.Markdown/Slices/_Layout.cshtml b/src/Elastic.Markdown/Slices/_Layout.cshtml index 4094c2275..6217cc456 100644 --- a/src/Elastic.Markdown/Slices/_Layout.cshtml +++ b/src/Elastic.Markdown/Slices/_Layout.cshtml @@ -2,7 +2,7 @@ @implements IUsesLayout @functions { public GlobalLayoutViewModel LayoutModel => Model; - protected override Task ExecuteSectionAsync(string name) + protected override async Task ExecuteSectionAsync(string name) { if (name == GlobalSections.Footer && Model.Layout is not LayoutName.Archive) { @@ -19,8 +19,15 @@ + //this ensures we forward footer sections declared in this project into to GlobalLayout view's section + await RenderSectionAsync(GlobalSections.Footer); + } + + if (name == GlobalSections.Head) + { + //this ensures we forward head sections declared in this project into to GlobalLayout view's section + await RenderSectionAsync(GlobalSections.Head); } - return Task.CompletedTask; } private async Task RenderDefault() {