Skip to content

[work in progress] Add products frontmatter, update applies_to as needed #1336

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

colleenmcginnis
Copy link
Contributor

Related to elastic/docs-builder#1200

Adds new products frontmatter, which will be used to generate metadata during the build process that the web team will use in the search experience (so users can filter by product). It also checks applies_to and adds additional items based on the products that are covered on the page.

Here's the process:

  • Map AsciiDoc/v3 products: @KOTungseth created a list of all AsciiDoc books mapped to:
    • Product names (including the format of the name)
    • applies_to badges associated with the products covered in that book
  • Add frontmatter: Then I wrote a script that uses Kaarina's list to look at each Markdown file and:
    • Assign products associated with the AsciiDoc book(s) included in mapped_pages.
    • Check the existing list of applies_to badges for that page and compare it to the list of all applies_to badges mapped to the AsciiDoc book(s) included in that page's mapped_pages.
      • If there are missing applies_to badges, it adds them.
      • If there are additional existing applies_to badges that aren't associated with the mapped_pages, it preserves them (no existing badges should be deleted).
  • Format frontmatter: I standardized the order and format of the frontmatter items.
  • Validate frontmatter: I created frontmatter.config.yml and checked against it to make sure all frontmatter keys and product values are valid. (Note: I haven't checked that all the values of deployment and serverless options are valid/correctly formatted.)

cc @KOTungseth @reakaleek

@Mpdreamz
Copy link
Member

Mpdreamz commented May 2, 2025

Drive by notes:

  • Can we ensure docs-builder validates this?
  • Use kebab-case for all products names e.g ECS Logging .NET => ecs-logging-dotnet

@colleenmcginnis
Copy link
Contributor Author

colleenmcginnis commented May 2, 2025

Can we ensure docs-builder validates this?

Yes! elastic/docs-builder#1200 (comment)

Use kebab-case for all products names e.g ECS Logging .NET => ecs-logging-dotnet

Sure. Would we transform the kebab case version to the formatted text version in docs-builder when adding the meta tag to the HTML? Or should we ask the web team to transform it in the search experience?

@reakaleek
Copy link
Member

reakaleek commented May 9, 2025

@colleenmcginnis

How hard or easy would it be for you to add an id attribute to the product.

So instead of:

products:
 - apm

It would become

products:
  - id: apm

I think it's a relatively easy change now, and it will allow us to add properties in the future. just in case.

Also, it makes it semantically clear that it's some sort of ID and not the display name.

cc @elastic/docs-engineering

Related PR: elastic/docs-builder#1238

WDYT?

@bmorelli25 bmorelli25 marked this pull request as ready for review May 9, 2025 23:50
@bmorelli25 bmorelli25 requested a review from a team May 9, 2025 23:50
@reakaleek
Copy link
Member

Just confirming:

The page https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/1336/cloud-account/

contains the meta tags:

<meta class="elastic" name="product_name" content="Cloud Hosted,Cloud Serverless">
<meta name="DC.subject" content="Cloud Hosted,Cloud Serverless">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants