Skip to content

Commit 7d56a71

Browse files
authored
Revert "Refactor markdown and layout rendering by decoupling from `GlobalLayo…" (#1356)
This reverts commit 8df9149.
1 parent 8df9149 commit 7d56a71

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+314
-352
lines changed

src/Elastic.ApiExplorer/Endpoints/ApiEndpoint.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,10 @@ public EndpointNavigationItem(int depth, string url, ApiEndpoint apiEndpoint, La
5858
public ApiEndpoint Index { get; }
5959
public string Url { get; }
6060
public string NavigationTitle { get; }
61-
public bool Hidden => false;
6261

6362
public IReadOnlyCollection<OperationNavigationItem> NavigationItems { get; set; } = [];
6463

6564
public INodeNavigationItem<INavigationModel, INavigationItem> NavigationRoot { get; }
6665

6766
public INodeNavigationItem<INavigationModel, INavigationItem>? Parent { get; set; }
68-
69-
public int NavigationIndex { get; set; }
7067
}

src/Elastic.ApiExplorer/Endpoints/EndpointView.cshtml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,24 @@
77
{
88
DocSetName = "Api Explorer",
99
Description = "",
10+
Layout = null,
11+
PageTocItems = [],
1012
CurrentNavigationItem = Model.CurrentNavigationItem,
1113
Previous = null,
1214
Next = null,
1315
NavigationHtml = Model.NavigationHtml,
16+
LegacyPage = null,
1417
UrlPathPrefix = null,
18+
GithubEditUrl = null,
19+
ReportIssueUrl = null,
1520
AllowIndexing = false,
1621
CanonicalBaseUrl = null,
1722
GoogleTagManager = new GoogleTagManagerConfiguration(),
1823
Features = new FeatureFlags([]),
24+
Parents =
25+
[
26+
],
27+
Products = null,
1928
StaticFileContentHashProvider = Model.StaticFileContentHashProvider
2029
};
2130
}

src/Elastic.ApiExplorer/Landing/LandingNavigationItem.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ public class LandingNavigationItem : INodeNavigationItem<ApiLanding, EndpointNav
3434
public int Depth { get; }
3535
public ApiLanding Index { get; }
3636
public INodeNavigationItem<INavigationModel, INavigationItem>? Parent { get; set; }
37-
public int NavigationIndex { get; set; }
3837
public IReadOnlyCollection<EndpointNavigationItem> NavigationItems { get; set; } = [];
3938
public string Url { get; }
40-
public bool Hidden => false;
4139

4240
//TODO
4341
public string NavigationTitle { get; } = "API Documentation";

src/Elastic.ApiExplorer/Landing/LandingView.cshtml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,24 @@
77
{
88
DocSetName = "Api Explorer",
99
Description = "",
10+
Layout = null,
11+
PageTocItems = [],
1012
CurrentNavigationItem = Model.CurrentNavigationItem,
1113
Previous = null,
1214
Next = null,
1315
NavigationHtml = Model.NavigationHtml,
16+
LegacyPage = null,
1417
UrlPathPrefix = null,
18+
GithubEditUrl = null,
19+
ReportIssueUrl = null,
1520
AllowIndexing = false,
1621
CanonicalBaseUrl = null,
1722
GoogleTagManager = new GoogleTagManagerConfiguration(),
1823
Features = new FeatureFlags([]),
24+
Parents =
25+
[
26+
],
27+
Products = null,
1928
StaticFileContentHashProvider = Model.StaticFileContentHashProvider
2029
};
2130
}

src/Elastic.ApiExplorer/Operations/OperationNavigationItem.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,8 @@ public OperationNavigationItem(int depth, string url, ApiOperation apiOperation,
4747
public int Depth { get; }
4848
public ApiOperation Model { get; }
4949
public string Url { get; }
50-
public bool Hidden => false;
5150

5251
public string NavigationTitle { get; }
5352

5453
public INodeNavigationItem<INavigationModel, INavigationItem>? Parent { get; set; }
55-
56-
public int NavigationIndex { get; set; }
57-
5854
}

src/Elastic.ApiExplorer/Operations/OperationView.cshtml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,24 @@
77
{
88
DocSetName = "Api Explorer",
99
Description = "",
10+
Layout = null,
11+
PageTocItems = [],
1012
CurrentNavigationItem = Model.CurrentNavigationItem,
1113
Previous = null,
1214
Next = null,
1315
NavigationHtml = Model.NavigationHtml,
16+
LegacyPage = null,
1417
UrlPathPrefix = null,
18+
GithubEditUrl = null,
19+
ReportIssueUrl = null,
1520
AllowIndexing = false,
1621
CanonicalBaseUrl = null,
1722
GoogleTagManager = new GoogleTagManagerConfiguration(),
1823
Features = new FeatureFlags([]),
24+
Parents =
25+
[
26+
],
27+
Products = null,
1928
StaticFileContentHashProvider = Model.StaticFileContentHashProvider
2029
};
2130
}

src/Elastic.Documentation.Configuration/TableOfContents/ITocItem.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,4 @@ public record TocReference(Uri Source, ITableOfContentsScope TableOfContentsScop
2222
{
2323
public IReadOnlyDictionary<Uri, TocReference> TocReferences { get; } =
2424
Children.OfType<TocReference>().ToDictionary(kv => kv.Source, kv => kv);
25-
26-
/// <summary>
27-
/// A phantom table of contents is a table of contents that is not rendered in the UI but is used to generate the TOC.
28-
/// This should be used sparingly and needs explicit configuration in navigation.yml.
29-
/// It's typically used for container TOC that holds various other TOC's where its children are rehomed throughout the navigation.
30-
/// <para>Examples of phantom toc's:</para>
31-
/// <list type="">
32-
/// <item> - toc: elasticsearch://reference</item>
33-
/// <item> - toc: docs-content://</item>
34-
/// </list>
35-
/// <para>Because navigation.yml does exhaustive checks to ensure all toc.yml files are referenced, marking these containers as phantoms
36-
/// ensures that these skip validation checks
37-
/// </para>
38-
/// </summary>
39-
public bool IsPhantom { get; init; }
4025
}
41-

src/Elastic.Markdown/Slices/Layout/_Archive.cshtml renamed to src/Elastic.Documentation.Site/Layout/_Archive.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@inherits RazorSlice<MarkdownLayoutViewModel>
1+
@inherits RazorSlice<Elastic.Documentation.Site.GlobalLayoutViewModel>
22
<div class="bg-[#F5F7FA] w-full px-8 py-16 text-center">
33
<div class="container mx-auto mt-20">
44
<h1 class="text-4xl md:text-6xl">Archive</h1>

src/Elastic.Documentation.Site/Layout/_Head.cshtml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@inherits RazorSlice<Elastic.Documentation.Site.GlobalLayoutViewModel>
22
@using FontPreloader = Elastic.Documentation.Site.FileProviders.FontPreloader
3+
<head hx-head="merge">
34
<meta charset="utf-8">
45
<title>@Model.Title</title>
56
<meta name="description" content="@Model.Description">
@@ -34,3 +35,9 @@
3435
{
3536
<meta property="og:url" content="@Model.CanonicalUrl" />
3637
}
38+
@if (!string.IsNullOrEmpty(Model.Products))
39+
{
40+
<meta class="elastic" name="product_name" content="@(Model.Products)"/>
41+
<meta name="DC.subject" content="@(Model.Products)"/>
42+
}
43+
</head>

src/Elastic.Markdown/Slices/Layout/_LandingPage.cshtml renamed to src/Elastic.Documentation.Site/Layout/_LandingPage.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@inherits RazorSlice<MarkdownLayoutViewModel>
1+
@inherits RazorSlice<Elastic.Documentation.Site.GlobalLayoutViewModel>
22
<div class="w-full text-ink relative text-pretty">
33
<div class="w-full absolute top-0 left-0 right-0 htmx-indicator" id="htmx-indicator" role="status">
44
<div class="h-[2px] w-full overflow-hidden">

0 commit comments

Comments
 (0)