RFC Search Engine Optimization Meta #2115
Replies: 3 comments 5 replies
-
options to add og tags? |
Beta Was this translation helpful? Give feedback.
-
Hello, It looks like Also, the documentation doesn't appear to be correct. currently it's export const meta: MetaFunction<typeof loader> = ({data, matches}) => {
// Pass one or more arguments, preserving properties from parent routes
return getSeoMeta((matches as any).data.seo, data!.seo);
}; but that doesn't really work since matches is an array (although maybe that's a typo since I just saw the js version is using the first value of matches). I think it would be nicer if we could just send an array into the export const meta: MetaFunction<typeof loader> = ({data, matches}) => getSeoMeta(matches.map(match => match.data.seo)); |
Beta Was this translation helpful? Give feedback.
-
Open Graph seems to require an |
Beta Was this translation helpful? Give feedback.
-
Hydrogen provides the getSeoMeta helper function to help developers generate the meta in Remix. This utility is low-level and doesn’t help the developer know what metadata is necessary or best practice for specific types of pages. For example, what metadata is best practice for a product detail page, or a listing page?
We propose adding new helper functions for enumerated page types. These functions will have TypeScript types and runtime checks and produce default metadata for each page type. The resulting metadata can be overridden if the developer wants to change it.
API Signature
We either create new helper function exports, or group them all on the existing export:
Page types and default metadata
These are what we propose is “best practice” for each page type:
Root
Used within the root route and common for the whole site, unless overridden by a child route:
Available params:
Questions
Home page
Available params:
Questions
Product Detail Page
Available params:
Questions
Collection Page
Available params:
Questions
Collection Listing Page
Available params:
Questions
Blog
Available params:
Questions
Article
Available params:
Questions
Beta Was this translation helpful? Give feedback.
All reactions