Skip to content

Commit

Permalink
fix: set hero subtitle as meta description of homepage (#892)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcshzj authored Nov 20, 2024
1 parent 410cd5b commit 11425c5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/components/src/engine/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ export const getMetadata = (props: IsomerPageSchemaType) => {
props.layout === "collection"
) {
metadata.description = props.page.subtitle
} else if (
metadata.description === undefined &&
props.layout === "homepage"
) {
metadata.description = props.content.find(
(item) => item.type === "hero",
)?.subtitle
}

if (props.page.permalink === "/") {
Expand Down

0 comments on commit 11425c5

Please sign in to comment.