opensearch-project / project-website

The source to opensearch.org
https://opensearch.org
BSD 3-Clause "New" or "Revised" License
40 stars 475 forks source link

Blog twittercard sharing #2970

Closed kaimmej closed 3 months ago

kaimmej commented 3 months ago

Issue:

twittercard metadata was not being pulled correctly and rendered into the html of our blog posts. When we went to share them, we were not including all of the information that twitter was expecting. The twitter sharing images looked wierd for 2 reasons: (1) we were applying the label "summary" instead of "summary image large". Twitter displays different cards depending on what we communicate in these meta tags. and (2) we were giving a small OpenSearch logo image, instead of an image at the correct 2:1 ratio. Additionally, sharing to other sites, such as facebook or Linkedin was broken because we were providing a different image and that image was 404'ing. og image

Summary of changes:

This pull request also includes 8 generic images for the most common blog post categories. I fixed the logic that was rendering the twitter metatags, organized the file, and added additional metatags that I found in the twitter docs. I removed the twittercard information from head.html, and abstracted it into head-twitter-metatags.html. I added generic images for the blog post categories into a new _data file (post_categories.yml) and the logic to pull them into the metadata of blog posts.

File changes:

_data/post_categories.yml

_includes/head-twitter-metatags.html

_includes/head.html

_layouts/default.html

Issues Resolved

Check List

By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License.

Notes:

Inspecting the page source for one of our most recent blog posts - we see that the twitter:image is different from the opengraph image. The opengraph image 404's. image