Skip to content

Commit fbe4116

Browse files
authored
Forward nested layout sections to global layout (#1386)
1 parent c245d33 commit fbe4116

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Elastic.Markdown/Slices/_Layout.cshtml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@implements IUsesLayout<Elastic.Documentation.Site._GlobalLayout, GlobalLayoutViewModel>
33
@functions {
44
public GlobalLayoutViewModel LayoutModel => Model;
5-
protected override Task ExecuteSectionAsync(string name)
5+
protected override async Task ExecuteSectionAsync(string name)
66
{
77
if (name == GlobalSections.Footer && Model.Layout is not LayoutName.Archive)
88
{
@@ -19,8 +19,15 @@
1919
</button>
2020
</div>
2121
</aside>
22+
//this ensures we forward footer sections declared in this project into to GlobalLayout view's section
23+
await RenderSectionAsync(GlobalSections.Footer);
24+
}
25+
26+
if (name == GlobalSections.Head)
27+
{
28+
//this ensures we forward head sections declared in this project into to GlobalLayout view's section
29+
await RenderSectionAsync(GlobalSections.Head);
2230
}
23-
return Task.CompletedTask;
2431
}
2532
private async Task RenderDefault()
2633
{

0 commit comments

Comments
 (0)