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

Refactor OpenGraph and Twitter Meta Tag Generation #304

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

bastosmichael
Copy link
Contributor

This pull request introduces enhancements to the _includes/opengraph.html template:

  1. URL Concatenation - Changed how the URLs are concatenated, using the append filter for more readability and consistency.

  2. OG & Twitter Image Logic - Improved the logic for setting OpenGraph and Twitter images:

    • If page.post_image exists and is not empty, it is used.
    • Otherwise, if page.image exists and is not empty, it is used.
    • If neither exist, a default image is used.
  3. Description Enhancement - For both Facebook and Twitter meta tags, the description now defaults to page.description if it exists. If not, it falls back to page.title. This gives more accurate and contextually relevant descriptions.

Feedback and further suggestions are welcome!

Copy link
Member

@michaelwnau michaelwnau left a comment

Choose a reason for hiding this comment

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

Reviewed.

@bastosmichael bastosmichael merged commit 0c0bc12 into main Oct 27, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants