Skip to content

Add products frontmatter #1226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageVersion Include="Amazon.Lambda.SQSEvents" Version="2.2.0" />
<PackageVersion Include="AWSSDK.Core" Version="4.0.0.2" />
<PackageVersion Include="AWSSDK.SQS" Version="4.0.0.1" />
<PackageVersion Include="AWSSDK.S3" Version="4.0.0.1"/>
<PackageVersion Include="AWSSDK.S3" Version="4.0.0.1" />
</ItemGroup>
<!-- Build -->
<ItemGroup>
Expand All @@ -32,7 +32,7 @@
<PackageVersion Include="Crayon" Version="2.0.69" />
<PackageVersion Include="DotNet.Glob" Version="3.1.3" />
<PackageVersion Include="Errata" Version="0.14.0" />
<PackageVersion Include="Github.Actions.Core" Version="9.0.0"/>
<PackageVersion Include="Github.Actions.Core" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.4" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.4" />
<PackageVersion Include="Markdig" Version="0.41.1" />
Expand All @@ -48,6 +48,7 @@
<PackageVersion Include="Vecc.YamlDotNet.Analyzers.StaticGenerator" Version="16.1.3" PrivateAssets="All" />
<PackageVersion Include="Westwind.AspNetCore.LiveReload" Version="0.5.2" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
<PackageVersion Include="Supernova.Enum.Generators" Version="1.0.17" />
</ItemGroup>
<!-- Test packages -->
<ItemGroup>
Expand All @@ -63,4 +64,4 @@
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" />
<PackageVersion Include="xunit.v3" Version="1.1.0" />
</ItemGroup>
</Project>
</Project>
92 changes: 90 additions & 2 deletions docs/syntax/frontmatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,111 @@ navigation_title: This is the navigation title <1>
description: This is a description of the page <2>
applies_to: <3>
serverless: all
products: <4>
- apm-java-agent
- edot-java
---
```

1. [`navigation_title`](#navigation-title)
2. [`description`](#description)
3. [`applies_to`](#applies-to)
4. [`products`](#products)

## Navigation Title

See [](./titles.md)

## Description

Use the `description` frontmatter to set the description meta tag for a page.
Use the `description` frontmatter to set the description meta tag for a page.
This helps search engines and social media.
It also sets the `og:description` and `twitter:description` meta tags.

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

## Applies to

See [](./applies.md)

## Products

The products frontmatter is a list of products that the page relates to.
This is used for the "Products" filter in the Search UI.

The products frontmatter is a list of strings, each string is the id of a product.

| Product ID | Product Name |
|---------------------------------------------|-----------------------------------------------|
| `apm` | APM |
| `apm-android-agent` | APM Android Agent |
| `apm-attacher` | APM Attacher |
| `apm-aws-lambda-extension` | APM AWS Lambda extension |
| `apm-dotnet-agent` | APM .NET Agent |
| `apm-go-agent` | APM Go Agent |
| `apm-ios-agent` | APM iOS Agent |
| `apm-java-agent` | APM Java Agent |
| `apm-node-agent` | APM Node.js Agent |
| `apm-php-agent` | APM PHP Agent |
| `apm-python-agent` | APM Python Agent |
| `apm-ruby-agent` | APM Ruby Agent |
| `apm-rum-agent` | APM RUM Agent |
| `beats-logging-plugin` | Beats Logging plugin |
| `cloud-control-ecctl` | Cloud Control ECCTL |
| `cloud-enterprise` | Cloud Enterprise |
| `cloud-hosted` | Cloud Hosted |
| `cloud-kubernetes` | Cloud Kubernetes |
| `cloud-native-ingest` | Cloud Native Ingest |
| `cloud-serverless` | Cloud Serverless |
| `cloud-terraform` | Cloud Terraform |
| `ecs` | Elastic Common Schema (ECS) |
| `ecs-logging-dotnet` | ECS Logging .NET |
| `ecs-logging-go-logrus` | ECS Logging Go Logrus |
| `ecs-logging-go-zap` | ECS Logging Go Zap |
| `ecs-logging-go-zerolog` | ECS Logging Go Zerolog |
| `ecs-logging-java` | ECS Logging Java |
| `ecs-logging-node` | ECS Logging Node.js |
| `ecs-logging-php` | ECS Logging PHP |
| `ecs-logging-python` | ECS Logging Python |
| `ecs-logging-ruby` | ECS Logging Ruby |
| `edot-android` | Elastic Distribution of OpenTelemetry Android |
| `edot-collector` | Elastic Distribution of OpenTelemetry Collector |
| `edot-dotnet` | Elastic Distribution of OpenTelemetry .NET |
| `edot-ios` | Elastic Distribution of OpenTelemetry iOS |
| `edot-java` | Elastic Distribution of OpenTelemetry Java |
| `edot-nodejs` | Elastic Distribution of OpenTelemetry Node.js |
| `edot-php` | Elastic Distribution of OpenTelemetry PHP |
| `edot-python` | Elastic Distribution of OpenTelemetry Python |
| `elastic-agent` | Elastic Agent |
| `elastic-products-platform` | Elastic Products platform |
| `elastic-stack` | Elastic Stack |
| `elasticsearch` | Elasticsearch |
| `elasticsearch-apache-hadoop` | Elasticsearch Apache Hadoop |
| `elasticsearch-cloud-hosted-heroku` | Elasticsearch Cloud Hosted Heroku |
| `elasticsearch-community-clients` | Elasticsearch community clients |
| `elasticsearch-curator` | Elasticsearch Curator |
| `elasticsearch-dotnet-client` | Elasticsearch .NET Client |
| `elasticsearch-eland-python-client` | Elasticsearch Eland Python Client |
| `elasticsearch-go-client` | Elasticsearch Go Client |
| `elasticsearch-groovy-client` | Elasticsearch Groovy Client |
| `elasticsearch-java-client` | Elasticsearch Java Client |
| `elasticsearch-java-script-client` | Elasticsearch JavaScript Client |
| `elasticsearch-painless-scripting-language` | Elasticsearch Painless scripting language |
| `elasticsearch-perl-client` | Elasticsearch Perl Client |
| `elasticsearch-php-client` | Elasticsearch PHP Client |
| `elasticsearch-plugins` | Elasticsearch plugins |
| `elasticsearch-python-client` | Elasticsearch Python Client |
| `elasticsearch-resiliency-status` | Elasticsearch Resiliency Status |
| `elasticsearch-ruby-client` | Elasticsearch Ruby Client |
| `elasticsearch-rust-client` | Elasticsearch Rust Client |
| `fleet` | Fleet |
| `ingest` | Ingest |
| `integrations` | Integrations |
| `kibana` | Kibana |
| `logstash` | Logstash |
| `machine-learning` | Machine Learning |
| `observability` | Observability |
| `reference-architectures` | Reference Architectures |
| `search-ui` | Search UI |
| `security` | Security |
1 change: 1 addition & 0 deletions src/Elastic.Markdown/Elastic.Markdown.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="RazorSlices" />
<PackageReference Include="Slugify.Core" />
<PackageReference Include="Supernova.Enum.Generators" />
<PackageReference Include="Utf8StreamReader" />
<PackageReference Include="Vecc.YamlDotNet.Analyzers.StaticGenerator" />
<PackageReference Include="YamlDotNet" />
Expand Down
5 changes: 5 additions & 0 deletions src/Elastic.Markdown/IO/MarkdownFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ private YamlFrontMatter ReadYamlFrontMatter(string raw)
{
return YamlSerialization.Deserialize<YamlFrontMatter>(raw);
}
catch (InvalidProductException e)
{
Collector.EmitError(FilePath, "Invalid product in yaml front matter.", e);
return new YamlFrontMatter();
}
catch (Exception e)
{
Collector.EmitError(FilePath, "Failed to parse yaml front matter block.", e);
Expand Down
11 changes: 3 additions & 8 deletions src/Elastic.Markdown/Myst/FrontMatter/FrontMatterParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using System.Runtime.Serialization;
using YamlDotNet.Serialization;

namespace Elastic.Markdown.Myst.FrontMatter;

public enum LayoutName
{
[EnumMember(Value = "landing-page")] LandingPage,
[EnumMember(Value = "not-found")] NotFound,
[EnumMember(Value = "archive")] Archive
}

[YamlSerializable]
public class YamlFrontMatter
{
Expand All @@ -38,4 +30,7 @@ public class YamlFrontMatter

[YamlMember(Alias = "mapped_pages")]
public IReadOnlyCollection<string>? MappedPages { get; set; }

[YamlMember(Alias = "products")]
public IReadOnlyCollection<Product>? Products { get; set; }
}
14 changes: 14 additions & 0 deletions src/Elastic.Markdown/Myst/FrontMatter/Layout.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

using System.Runtime.Serialization;

namespace Elastic.Markdown.Myst.FrontMatter;

public enum LayoutName
{
[EnumMember(Value = "landing-page")] LandingPage,
[EnumMember(Value = "not-found")] NotFound,
[EnumMember(Value = "archive")] Archive
}
Loading
Loading