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

Fix: Prevent double title issue in SEO metadata by updating seo.html #4959

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

alouiadel
Copy link
Contributor

This is a bug fix.

Summary

This pull request addresses the issue of duplicated titles in the SEO metadata. The fix involves overriding the seo.html file and updating the logic to ensure the page title doesn't include the site title twice. The change ensures that the title displayed in the browser tab and metadata is clean and correctly formatted.

Changes Include:

  • Created a custom _includes/seo.html file.
  • Updated the logic in seo.html to prevent the page title from containing the site title twice.

Testing:

  • Verified that the title is no longer duplicated in the browser tab and in the generated HTML meta tags.

@iBug
Copy link
Collaborator

iBug commented Aug 20, 2024

I kind of consider it a feature that the page title uses site.title as a placeholder. And to keep in line with other pages where the title always ends in - {{ site.title }}, I'm not sure how a single page titled only {{ site.title }} would look better.

@alouiadel
Copy link
Contributor Author

The names of other pages will still display alongside the site title, like 'Portfolio | Site Title' or 'Posts | Site Title.' This fix only addresses the issue where 'Site Title | Site Title' appears as a duplicate in the browser tab

@alouiadel
Copy link
Contributor Author

Example after fixing it in my blog :
image
its only site title Adel Aloui Portfolio/Blog , instead of Adel Aloui Portfolio/Blog | Adel Aloui Portfolio/Blog
image
but here site title Adel Aloui Portfolio/Blog , gets added again

@iBug
Copy link
Collaborator

iBug commented Aug 20, 2024

OK, not as bad as I had imagined.

@iBug iBug merged commit 96149ca into mmistakes:master Aug 20, 2024
2 checks passed
@alouiadel alouiadel deleted the fix-bug-double-title branch August 21, 2024 21:29
minyoongi96 pushed a commit to minyoongi96/minyoongi96.github.io that referenced this pull request Aug 26, 2024
jessicarod7 added a commit to jessicarod7/jessicarod7.github.io that referenced this pull request Sep 8, 2024
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