Skip to content

Commit c61ba23

Browse files
committed
Add products frontmatter
1 parent f6f1d81 commit c61ba23

File tree

9 files changed

+543
-11
lines changed

9 files changed

+543
-11
lines changed

docs/syntax/frontmatter.md

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,111 @@ navigation_title: This is the navigation title <1>
1212
description: This is a description of the page <2>
1313
applies_to: <3>
1414
serverless: all
15+
products: <4>
16+
- apm-java-agent
17+
- edot-java
1518
---
1619
```
20+
1721
1. [`navigation_title`](#navigation-title)
1822
2. [`description`](#description)
1923
3. [`applies_to`](#applies-to)
24+
4. [`products](#products)
2025

2126
## Navigation Title
27+
2228
See [](./titles.md)
2329

2430
## Description
2531

26-
Use the `description` frontmatter to set the description meta tag for a page.
32+
Use the `description` frontmatter to set the description meta tag for a page.
2733
This helps search engines and social media.
2834
It also sets the `og:description` and `twitter:description` meta tags.
2935

30-
The `description` frontmatter is a string, recommended to be around 150 characters. If you don't set a `description`,
36+
The `description` frontmatter is a string, recommended to be around 150 characters. If you don't set a `description`,
3137
it will be generated from the first few paragraphs of the page until it reaches 150 characters.
3238

3339
## Applies to
40+
3441
See [](./applies.md)
42+
43+
## Products
44+
45+
The products frontmatter is a list of products that the page relates to.
46+
This is used for the "Products" filter in the Search UI.
47+
48+
The products frontmatter is a list of strings, each string is the id of a product.
49+
50+
| Product ID | Product Name |
51+
|---------------------------------------------|-----------------------------------------------|
52+
| `apm` | APM |
53+
| `apm-android-agent` | APM Android Agent |
54+
| `apm-attacher` | APM Attacher |
55+
| `apm-aws-lambda-extension` | APM AWS Lambda extension |
56+
| `apm-dotnet-agent` | APM .NET Agent |
57+
| `apm-go-agent` | APM Go Agent |
58+
| `apm-ios-agent` | APM iOS Agent |
59+
| `apm-java-agent` | APM Java Agent |
60+
| `apm-node-agent` | APM Node.js Agent |
61+
| `apm-php-agent` | APM PHP Agent |
62+
| `apm-python-agent` | APM Python Agent |
63+
| `apm-ruby-agent` | APM Ruby Agent |
64+
| `apm-rum-agent` | APM RUM Agent |
65+
| `beats-logging-plugin` | Beats Logging plugin |
66+
| `cloud-control-ecctl` | Cloud Control ECCTL |
67+
| `cloud-enterprise` | Cloud Enterprise |
68+
| `cloud-hosted` | Cloud Hosted |
69+
| `cloud-kubernetes` | Cloud Kubernetes |
70+
| `cloud-native-ingest` | Cloud Native Ingest |
71+
| `cloud-serverless` | Cloud Serverless |
72+
| `cloud-terraform` | Cloud Terraform |
73+
| `ecs` | Elastic Common Schema (ECS) |
74+
| `ecs-logging-dotnet` | ECS Logging .NET |
75+
| `ecs-logging-go-logrus` | ECS Logging Go Logrus |
76+
| `ecs-logging-go-zap` | ECS Logging Go Zap |
77+
| `ecs-logging-go-zerolog` | ECS Logging Go Zerolog |
78+
| `ecs-logging-java` | ECS Logging Java |
79+
| `ecs-logging-node` | ECS Logging Node.js |
80+
| `ecs-logging-php` | ECS Logging PHP |
81+
| `ecs-logging-python` | ECS Logging Python |
82+
| `ecs-logging-ruby` | ECS Logging Ruby |
83+
| `edot-android` | Elastic Distribution of OpenTelemetry Android |
84+
| `edot-collector` | Elastic Distribution of OpenTelemetry Collector |
85+
| `edot-dotnet` | Elastic Distribution of OpenTelemetry .NET |
86+
| `edot-ios` | Elastic Distribution of OpenTelemetry iOS |
87+
| `edot-java` | Elastic Distribution of OpenTelemetry Java |
88+
| `edot-nodejs` | Elastic Distribution of OpenTelemetry Node.js |
89+
| `edot-php` | Elastic Distribution of OpenTelemetry PHP |
90+
| `edot-python` | Elastic Distribution of OpenTelemetry Python |
91+
| `elastic-agent` | Elastic Agent |
92+
| `elastic-products-platform` | Elastic Products platform |
93+
| `elastic-stack` | Elastic Stack |
94+
| `elasticsearch` | Elasticsearch |
95+
| `elasticsearch-apache-hadoop` | Elasticsearch Apache Hadoop |
96+
| `elasticsearch-cloud-hosted-heroku` | Elasticsearch Cloud Hosted Heroku |
97+
| `elasticsearch-community-clients` | Elasticsearch community clients |
98+
| `elasticsearch-curator` | Elasticsearch Curator |
99+
| `elasticsearch-dotnet-client` | Elasticsearch .NET Client |
100+
| `elasticsearch-eland-python-client` | Elasticsearch Eland Python Client |
101+
| `elasticsearch-go-client` | Elasticsearch Go Client |
102+
| `elasticsearch-groovy-client` | Elasticsearch Groovy Client |
103+
| `elasticsearch-java-client` | Elasticsearch Java Client |
104+
| `elasticsearch-java-script-client` | Elasticsearch JavaScript Client |
105+
| `elasticsearch-painless-scripting-language` | Elasticsearch Painless scripting language |
106+
| `elasticsearch-perl-client` | Elasticsearch Perl Client |
107+
| `elasticsearch-php-client` | Elasticsearch PHP Client |
108+
| `elasticsearch-plugins` | Elasticsearch plugins |
109+
| `elasticsearch-python-client` | Elasticsearch Python Client |
110+
| `elasticsearch-resiliency-status` | Elasticsearch Resiliency Status |
111+
| `elasticsearch-ruby-client` | Elasticsearch Ruby Client |
112+
| `elasticsearch-rust-client` | Elasticsearch Rust Client |
113+
| `fleet` | Fleet |
114+
| `ingest` | Ingest |
115+
| `integrations` | Integrations |
116+
| `kibana` | Kibana |
117+
| `logstash` | Logstash |
118+
| `machine-learning` | Machine Learning |
119+
| `observability` | Observability |
120+
| `reference-architectures` | Reference Architectures |
121+
| `search-ui` | Search UI |
122+
| `security` | Security |

src/Elastic.Markdown/IO/MarkdownFile.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ private YamlFrontMatter ReadYamlFrontMatter(string raw)
330330
{
331331
return YamlSerialization.Deserialize<YamlFrontMatter>(raw);
332332
}
333+
catch (InvalidProductException e)
334+
{
335+
Collector.EmitHint(FilePath, "What");
336+
Collector.EmitError(FilePath, "Invalid product in yaml front matter.", e);
337+
return new YamlFrontMatter();
338+
}
333339
catch (Exception e)
334340
{
335341
Collector.EmitError(FilePath, "Failed to parse yaml front matter block.", e);

src/Elastic.Markdown/Myst/FrontMatter/FrontMatterParser.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,10 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System.Runtime.Serialization;
65
using YamlDotNet.Serialization;
76

87
namespace Elastic.Markdown.Myst.FrontMatter;
98

10-
public enum LayoutName
11-
{
12-
[EnumMember(Value = "landing-page")] LandingPage,
13-
[EnumMember(Value = "not-found")] NotFound,
14-
[EnumMember(Value = "archive")] Archive
15-
}
16-
179
[YamlSerializable]
1810
public class YamlFrontMatter
1911
{
@@ -38,4 +30,7 @@ public class YamlFrontMatter
3830

3931
[YamlMember(Alias = "mapped_pages")]
4032
public IReadOnlyCollection<string>? MappedPages { get; set; }
33+
34+
[YamlMember(Alias = "products")]
35+
public IReadOnlyCollection<Product>? Products { get; set; }
4136
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information
4+
5+
using System.Runtime.Serialization;
6+
7+
namespace Elastic.Markdown.Myst.FrontMatter;
8+
9+
public enum LayoutName
10+
{
11+
[EnumMember(Value = "landing-page")] LandingPage,
12+
[EnumMember(Value = "not-found")] NotFound,
13+
[EnumMember(Value = "archive")] Archive
14+
}

0 commit comments

Comments
 (0)