From 352e2681d9147ebb26f9ee384f5f29b7676ac85b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 13:43:33 +0000 Subject: [PATCH 1/3] Initial plan From fb805632e17dc0941502ecc52037b2932f4d7f0f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 13:51:21 +0000 Subject: [PATCH 2/3] fix: use blog hero image for social preview metadata Agent-Logs-Url: https://github.com/feast-dev/feast/sessions/8c33bcc6-0cd4-4222-95a1-bfa02f136b5b Co-authored-by: franciscojavierarceo <4163062+franciscojavierarceo@users.noreply.github.com> --- infra/website/src/layouts/BaseLayout.astro | 18 +++++++++++----- infra/website/src/pages/blog/[slug].astro | 24 ++++++++++++++++++++-- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/infra/website/src/layouts/BaseLayout.astro b/infra/website/src/layouts/BaseLayout.astro index d73c7b0ebde..05d940005ba 100644 --- a/infra/website/src/layouts/BaseLayout.astro +++ b/infra/website/src/layouts/BaseLayout.astro @@ -4,9 +4,17 @@ import '../styles/global.css'; interface Props { title: string; description?: string; + socialImage?: string; + ogUrl?: string; } -const { title, description = "Feast is an end-to-end open source feature store for machine learning. It allows teams to define, manage, discover, and serve features." } = Astro.props; +const defaultSocialImage = "https://feast.dev/wp-content/uploads/2023/01/feast-og@2x.png"; +const { + title, + description = "Feast is an end-to-end open source feature store for machine learning. It allows teams to define, manage, discover, and serve features.", + socialImage = defaultSocialImage, + ogUrl = "https://feast.dev/", +} = Astro.props; --- @@ -25,16 +33,16 @@ const { title, description = "Feast is an end-to-end open source feature store f - + - + - + @@ -51,4 +59,4 @@ const { title, description = "Feast is an end-to-end open source feature store f - \ No newline at end of file + diff --git a/infra/website/src/pages/blog/[slug].astro b/infra/website/src/pages/blog/[slug].astro index 7d6a780a14c..29687d79700 100644 --- a/infra/website/src/pages/blog/[slug].astro +++ b/infra/website/src/pages/blog/[slug].astro @@ -1,6 +1,21 @@ --- import BaseLayout from '../../layouts/BaseLayout.astro'; import Navigation from '../../components/Navigation.astro'; +import { readFileSync } from 'node:fs'; + +const SITE_URL = 'https://feast.dev'; + +function toAbsoluteUrl(path: string): string { + if (/^https?:\/\//i.test(path)) { + return path; + } + return new URL(path, SITE_URL).toString(); +} + +function extractHeroImage(markdown: string): string | undefined { + const heroImageMatch = markdown.match(/]*>[\s\S]*?]*src=["']([^"']+)["']/i); + return heroImageMatch?.[1]; +} export async function getStaticPaths() { const posts = await Astro.glob('../../../docs/blog/*.md'); @@ -17,9 +32,14 @@ export async function getStaticPaths() { const { post } = Astro.props; const { title, description, date, authors = [] } = post.frontmatter; +const blogUrl = `${SITE_URL}/blog/${Astro.params.slug}/`; +const frontmatterImage = post.frontmatter.hero_image || post.frontmatter.heroImage || post.frontmatter.image; +const markdown = readFileSync(post.file, 'utf-8'); +const heroImage = frontmatterImage || extractHeroImage(markdown); +const socialImage = heroImage ? toAbsoluteUrl(heroImage) : undefined; --- - +
@@ -316,4 +336,4 @@ const { title, description, date, authors = [] } = post.frontmatter; font-size: 18px; } } - \ No newline at end of file + From f2dd6f9e8b2ceb97e4da5b1bd633f2edb44009ac Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 13:53:01 +0000 Subject: [PATCH 3/3] fix: harden hero image extraction for blog social tags Agent-Logs-Url: https://github.com/feast-dev/feast/sessions/8c33bcc6-0cd4-4222-95a1-bfa02f136b5b Co-authored-by: franciscojavierarceo <4163062+franciscojavierarceo@users.noreply.github.com> --- infra/website/src/pages/blog/[slug].astro | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/infra/website/src/pages/blog/[slug].astro b/infra/website/src/pages/blog/[slug].astro index 29687d79700..90e8572d0b2 100644 --- a/infra/website/src/pages/blog/[slug].astro +++ b/infra/website/src/pages/blog/[slug].astro @@ -13,8 +13,12 @@ function toAbsoluteUrl(path: string): string { } function extractHeroImage(markdown: string): string | undefined { - const heroImageMatch = markdown.match(/]*>[\s\S]*?]*src=["']([^"']+)["']/i); - return heroImageMatch?.[1]; + const heroContainerMatch = markdown.match(/]*class=["'][^"']*\bhero-image\b[^"']*["'][^>]*>([\s\S]*?)<\/div>/i); + if (!heroContainerMatch?.[1]) { + return undefined; + } + const imageMatch = heroContainerMatch[1].match(/]*\bsrc=["']([^"']+)["'][^>]*>/i); + return imageMatch?.[1]; } export async function getStaticPaths() { @@ -34,8 +38,7 @@ const { post } = Astro.props; const { title, description, date, authors = [] } = post.frontmatter; const blogUrl = `${SITE_URL}/blog/${Astro.params.slug}/`; const frontmatterImage = post.frontmatter.hero_image || post.frontmatter.heroImage || post.frontmatter.image; -const markdown = readFileSync(post.file, 'utf-8'); -const heroImage = frontmatterImage || extractHeroImage(markdown); +const heroImage = frontmatterImage || extractHeroImage(readFileSync(post.file, 'utf-8')); const socialImage = heroImage ? toAbsoluteUrl(heroImage) : undefined; ---