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

Enable and customize open graph tags #54

Merged
merged 2 commits into from
Mar 12, 2024
Merged

Enable and customize open graph tags #54

merged 2 commits into from
Mar 12, 2024

Conversation

ryelle
Copy link
Contributor

@ryelle ryelle commented Mar 11, 2024

This PR force-enables the Jetpack Open Graph behavior, and then runs over the values to customize them slightly. Mostly to make sure they're consistent and accurate for each value/page.

I've used the main developer.w.org's default image, but we can easily swap that out before merging this PR if there's a DevBlog specific one.

Fixes #53

Screenshots

I've been testing by manually checking the generated code, so that's what I'm sharing here.

Homepage: uses the default image, site title, and site description.

home

Article, with a featured image: uses the featured image, post title, and excerpt.

post-with-image

Article without a featured image: uses the default image, post title, and excerpt.

post-no-image

Category (& other archive pages): uses the default image, archive title, and description (omitted if not available or relevant).

category

To test

  • Load any page, view source or inspect the head
  • Find <!-- Jetpack Open Graph Tags -->
  • The tags should be accurate to the page they are on

(I know there's a way to test locally with a tunnel, but I haven't tried that.)

@ryelle ryelle requested a review from adamwoodnz March 11, 2024 22:40
@ryelle ryelle self-assigned this Mar 11, 2024
@ryelle ryelle added the [Component] Backend Anything wp-admin or PHP-related label Mar 11, 2024
Copy link
Collaborator

@justintadlock justintadlock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to review the code, which looks good to me. I don't have a full setup to test the site right now. @ndiego might want to do a final sign-off.

@ndiego
Copy link
Member

ndiego commented Mar 12, 2024

I was able to review the code, which looks good to me. I don't have a full setup to test the site right now. @ndiego might want to do a final sign-off.

You both know more about Open Graph tag implementation than I do 😅, but this looks good to me with the new image in #53

Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: LGTM too

@ryelle ryelle merged commit 9bf6db2 into trunk Mar 12, 2024
@ryelle ryelle deleted the update/open-graph branch March 12, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Backend Anything wp-admin or PHP-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Open Graph tags using code instead of Jetpack
4 participants