-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add schema.org and JSONLD to pages #16186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…dcrumb and creative work details
…metadata and breadcrumb navigation
…g metadata, breadcrumb navigation, and item list details
…etadata, breadcrumb navigation, and community resources details
…uding acknowledgements, contributors, and translatathon leaderboard with metadata and breadcrumb navigation
…adata, breadcrumb navigation, and resource details for tutorials, learning tools, local environment, and main developers page
…metadata, breadcrumb navigation, and publisher information
…ata, breadcrumb navigation, and publisher information
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@corwintines maybe a late comment on this work but was wondering if we could abstract this code in a separate file to avoid adding too many things in each file and see if we can avoid some duplication
new-page/
├─ page.tsx
├─ page-jsonld.ts // exports an adapted PageJsonLD component to be used in page.tsx
components/
├─ PageJsonLD.tsx // generic component that prints the `script` tags
We could set a pattern for all pages to look like this.
At the page level
import PageJsonLD from "./page-jsonld"
return (
<PageJsonLD {...frontmatter} />
...rest
)
===
related issue to the mindset I had for this implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@corwintines I've found two small issues. The rest looks great 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orphan?
"@id": "https://ethereum.org", | ||
name: "ethereum.org", | ||
url: "https://ethereum.org", | ||
logo: "https://ethereum.org/images/ethereum-logo.png", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image doesn't exist. Maybe https://ethereum.org/images/eth-org-logo.png
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted that this one fails because this is used inside a client component. We need to use useTranslations
.
Description
Can test schemas on https://search.google.com/test/rich-results
https://technicalseo.com/tools/google-serp-simulator/
More info on structured data: https://developers.google.com/search/docs/appearance/structured-data/search-gallery
More info on Schema.org: https://schema.org/
Info on JSON-LD: https://nextjs.org/docs/app/guides/json-ld