Skip to content

Commit

Permalink
Replace obsolete 'hero image' (renamed a long time ago) with 'image'
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinstubbs committed Jan 16, 2025
1 parent 6631e17 commit c9b5305
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions starters/gatsby-starter-ts/src/components/grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const PostGridItem = ({ content: article }) => {
return (
<GridItem
href={`/articles/${article.slug || article.id}`}
imgSrc={article.metadata?.["Hero Image"]}
imgSrc={article.metadata?.["image"]}
title={article.title}
tags={article.tags}
/>
Expand All @@ -57,7 +57,7 @@ const PageGridItem = ({ content: article }) => {
return (
<GridItem
href={`/articles/${article.slug || article.id}`}
imgSrc={article.metadata?.["Hero Image"]}
imgSrc={article.metadata?.["image"]}
title={article.title}
tags={article.tags}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const getSeoMetadata = (article: Article) => {
});

const images = [
article.metadata?.["Hero Image"],
article.metadata?.["image"],
// Extend as needed
].filter((i): i is string => typeof i === "string");

Expand Down
4 changes: 2 additions & 2 deletions starters/gatsby-starter/src/components/grid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const PostGridItem = ({ content: article }) => {
return (
<GridItem
href={`/articles/${article.slug || article.id}`}
imgSrc={article.metadata?.["Hero Image"]}
imgSrc={article.metadata?.["image"]}
title={article.title}
tags={article.tags}
/>
Expand All @@ -47,7 +47,7 @@ const PageGridItem = ({ content: article }) => {
return (
<GridItem
href={`/articles/${article.slug || article.id}`}
imgSrc={article.metadata?.["Hero Image"]}
imgSrc={article.metadata?.["image"]}
title={article.title}
tags={article.tags}
/>
Expand Down
2 changes: 1 addition & 1 deletion starters/gatsby-starter/src/templates/articles/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const getSeoMetadata = (article) => {
});

const images = [
article.metadata?.["Hero Image"],
article.metadata?.["image"],
// Extend as needed
].filter((url) => typeof url === "string");

Expand Down
2 changes: 1 addition & 1 deletion starters/nextjs-starter-approuter-ts/components/grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function ArticleGridCard({
isWide = false,
}: ArticleGridCardProps) {
const targetHref = `${basePath}/${article.metadata?.slug || article.id}`;
const imageSrc = (article.metadata?.["Hero Image"] as string) || null;
const imageSrc = (article.metadata?.["image"] as string) || null;

return (
<div
Expand Down
2 changes: 1 addition & 1 deletion starters/nextjs-starter-approuter-ts/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function getSeoMetadata(
article.tags && article.tags.length > 0 ? article.tags : [];
const imageProperties = [
article.metadata?.image,
article.metadata?.["Hero Image"],
article.metadata?.["image"],
// Extend as needed
]
.filter((url): url is string => typeof url === "string")
Expand Down
2 changes: 1 addition & 1 deletion starters/nextjs-starter-ts/components/grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function ArticleGridCard({
isWide = false,
}: ArticleGridCardProps) {
const targetHref = `${basePath}/${article.slug || article.id}`;
const imageSrc = (article.metadata?.["Hero Image"] as string) || null;
const imageSrc = (article.metadata?.["image"] as string) || null;

return (
<div
Expand Down
2 changes: 1 addition & 1 deletion starters/nextjs-starter-ts/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function getSeoMetadata(article: ArticleWithoutContent) {
article.tags && article.tags.length > 0 ? article.tags : [];
const imageProperties = [
article.metadata?.image,
article.metadata?.["Hero Image"],
article.metadata?.["image"],
// Extend as needed
]
.filter((url): url is string => typeof url === "string")
Expand Down
2 changes: 1 addition & 1 deletion starters/nextjs-starter/components/grid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function ArticleGridCard({
isWide = false,
}) {
const targetHref = `${basePath}/${article.slug || article.id}`;
const imageSrc = article.metadata?.["Hero Image"] || null;
const imageSrc = article.metadata?.["image"] || null;

return (
<div
Expand Down
2 changes: 1 addition & 1 deletion starters/nextjs-starter/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function getSeoMetadata(article) {
const tags = article.tags && article.tags.length > 0 ? article.tags : [];
const imageProperties = [
article.metadata?.image,
article.metadata?.["Hero Image"],
article.metadata?.["image"],
// Extend as needed
]
.filter((url) => typeof url === "string")
Expand Down

0 comments on commit c9b5305

Please sign in to comment.