From 79f75ca185a099073358a7d11ab7e494fc46c13c Mon Sep 17 00:00:00 2001 From: Florian Dieminger Date: Wed, 21 Aug 2024 01:32:16 +0200 Subject: [PATCH] feat(doc): add pageType field (#11662) Helpful for quickly looking up the page type, but also useful for future features. --- build/index.ts | 2 ++ libs/types/document.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/build/index.ts b/build/index.ts index 34946c41cc07..c9cb88533910 100644 --- a/build/index.ts +++ b/build/index.ts @@ -529,6 +529,8 @@ export async function buildDocument( doc.other_translations = document.translations || []; + doc.pageType = metadata["page-type"] || "unknown"; + injectSource(doc, document, metadata); if (document.metadata["short-title"]) { diff --git a/libs/types/document.ts b/libs/types/document.ts index 8a8990dfb106..f12ea19725e7 100644 --- a/libs/types/document.ts +++ b/libs/types/document.ts @@ -153,6 +153,7 @@ export interface DocMetadata { browserCompat?: string[]; baseline?: SupportStatus; hash?: string; + pageType: string; } export interface Doc extends DocMetadata {