diff --git a/src/components/overrides/Head.astro b/src/components/overrides/Head.astro index fa44c498bb54d0..870214beb093d5 100644 --- a/src/components/overrides/Head.astro +++ b/src/components/overrides/Head.astro @@ -35,26 +35,28 @@ if (currentSection) { let product = await getEntry("products", currentSection); // if entry for changelog, grab the first product value (which corresponds to the folder the entry is in) and use as the primary "product" if (currentSection === "changelog") { - const products = frontmatter.products + const products = frontmatter.products; if (products) { product = await getEntry("products", products[0]); } } if (product) { - let productMetaName = product.data.meta.title ? product.data.meta.title : "Cloudflare Docs"; + let productMetaName = product.data.meta.title + ? product.data.meta.title + : "Cloudflare Docs"; if (currentSection === "changelog") { - productMetaName = "Changelog" + productMetaName = "Changelog"; } const titleIdx = head.findIndex((x) => x.tag === "title"); let title: string; // Prefer the title set via frontmatter.head.title. If not, grab the regular frontmatter title value. - const existingTitle = head[titleIdx].content ? head[titleIdx].content?.split( - ` ${DEFAULT_TITLE_DELIMITER} `, - )[0]: frontmatter.title; + const existingTitle = head[titleIdx].content + ? head[titleIdx].content?.split(` ${DEFAULT_TITLE_DELIMITER} `)[0] + : frontmatter.title; title = `${existingTitle} ยท ${productMetaName}`; @@ -128,8 +130,13 @@ if ( if (frontmatter.pcx_content_type) { ["pcx_content_type", "algolia_content_type"].map((name) => { - const contentType = frontmatter.pcx_content_type - const updatedName = contentType ? (contentType.charAt(0).toUpperCase() + contentType.slice(1)).replace("-", " ") : "" + const contentType = frontmatter.pcx_content_type; + const updatedName = contentType + ? (contentType.charAt(0).toUpperCase() + contentType.slice(1)).replace( + "-", + " ", + ) + : ""; metaTags.push({ name, content: updatedName, @@ -217,7 +224,6 @@ metaTags.map((attrs) => { attrs, }); }); - --- diff --git a/src/pages/changelog/[...slug].astro b/src/pages/changelog/[...slug].astro index 56d28268553444..fda014505c8a89 100644 --- a/src/pages/changelog/[...slug].astro +++ b/src/pages/changelog/[...slug].astro @@ -36,7 +36,8 @@ const props = { noindex: note.data.hidden, chatbot_deprioritize: true, pcx_content_type: "changelog-entry", - products: note.data.products.map(a => a.id), + products: note.data.products.map((a) => a.id), + lastUpdated: note.data.date, }, headings, hideTitle: true,