Skip to content
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

feat(seo): add Article structured data #225

Merged
merged 1 commit into from
Sep 23, 2023

Conversation

julien-deramond
Copy link
Member

@julien-deramond julien-deramond commented Sep 23, 2023

Description

This PR adds some structured data for Open {re}Source articles based on https://developers.google.com/search/docs/appearance/structured-data/article#json-ld.

The result has been tested via https://search.google.com/test/rich-results?utm_campaign=devsite&utm_medium=jsonld&utm_source=article.

The schema is automatically filled out with the basic information from the articles' frontmatter but can be overwritten in the articles' frontmatter itself too if needed in the future.

https://main-branch-openresource-dev-git-main-jd-a-7640e3-open-resource.vercel.app/articles/github-marketplace-social-preview-for-your-github-actions contains for example:

<script type="application/ld+json">{
  "@context": "https://schema.org/",
  "@type": "Article",
  "headline": "GitHub Marketplace: Social Preview for Your GitHub Actions",
  "description": "Learn how to create and add a social preview image to your GitHub repository to have a better rendering when sharing on social media platforms the link of your GitHub Actions on the GitHub Marketplace.'",
  "image": "https://openresource.dev/og-image.png",
  "author": {
    "@type": "Person",
    "name": "Julien Déramond",
    "url": "https://github.com/julien-deramond/"
  },
  "publisher": {
    "@type": "Organization",
    "name": "Open &lcub;re&rcub;Source",
    "url": "https://openresource.dev/",
    "logo": {
      "@type": "ImageObject",
      "url": "https://openresource.dev/android-chrome-192x192.png"
    }
  },
  "datePublished": "2023-09-15",
  "dateModified": "2023-09-18"
}</script>

and other pages don't contain this type of information.

Motivation & Context

This feature will prolly help with the referencing of Open {re}Source articles in Google.

Type of changes

  • New feature (non-breaking change which adds functionality)

Checklist

@julien-deramond julien-deramond added the feature Something can be improved label Sep 23, 2023
@vercel
Copy link

vercel bot commented Sep 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
main-branch-openresource-dev ✅ Ready (Inspect) Visit Preview Sep 23, 2023 7:51am

@julien-deramond julien-deramond merged commit ad802a0 into main Sep 23, 2023
3 checks passed
@julien-deramond julien-deramond deleted the main-jd-add-article-structured-data branch September 23, 2023 07:53
@julien-deramond
Copy link
Member Author

This feature has been deployed into production. https://openresource.dev/articles/github-marketplace-social-preview-for-your-github-actions for instance now contains Article structured data that is recognized by Google (tested with https://search.google.com/test/rich-results and the Open {re}Source URL).

See the results: https://search.google.com/test/rich-results/result?id=9Wa3sKrwNIgIPbNQex8RnA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Something can be improved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant