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

Improve page metadata for sharing #274

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dempseyatgithub
Copy link
Collaborator

This PR addresses the issues in Issue #203:

  • In _config.yml file:
    • Enable page excerpts
    • Set excerpt separator
  • In base layout:
    • Calculate title, description, URL in one place for meta tags
    • Always use page values for meta tags when present, fallback to site values
    • Replace conditional tags with single tag that uses calculated value
    • Move robots meta tag out from the middle of Open Graph tags
    • Reduce excessive whitespace from generated newlines
  • Add explicit excerpts to front matter of pages where automatic excerpt was not suitable / sufficient
  • Small adjustments to page first paragraphs to generate better description meta tags
  • Resolves Meta tag, Open Graph, and Twitter sharing metadata problems #203

- In _config.yml file:
  - Enable page excerpts
  - Set excerpt separator
- In base layout:
  - Calculate title, description, URL in one place for meta tags
  - Always use page values for meta tags when present, fallback to site values
  - Replace conditional tags with single tag that uses calculated value
  - Move robots meta tag out from the middle of Open Graph tags
  - Reduce excessive whitespace from generated newlines
- Add explicit excerpts to front matter of pages where automatic
  excerpt was not suitable / sufficient
- Small adjustments to page first paragraphs to generate better description
  meta tags
- Resolves apple#203
@dempseyatgithub
Copy link
Collaborator Author

@swift-ci test

@dempseyatgithub dempseyatgithub marked this pull request as draft March 31, 2023 13:45
@dempseyatgithub
Copy link
Collaborator Author

I just found an unexpected issue with this PR.

It causes all the posts on the main blog page to render full text instead of excerpts.

I won't have time today to track down the cause, but will turn this back into a full PR once I address that issue.

@dempseyatgithub
Copy link
Collaborator Author

I have spent some time investigating the issue.

There seems to be a bug in Jekyll where turning on page excerpts causes each post on the blog page to display its full text and not its excerpt.

I tested with the latest version of Jekyll and still see this issue.

I also have found the issue to be nondeterministic. Sometimes I can enable page excerpts without the bug occurring, sometimes it seems adding a call into the page excerpt for the meta tags causes it to happen. However, backing out the changes does not always revert the behavior.

I haven't found a similar issue mentioned searching in Jekyll forums. My next step would be to try to reproduce the issue in a simple Jekyll project.

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.

Meta tag, Open Graph, and Twitter sharing metadata problems
1 participant