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

tpl: Improve generation of OpenGraph date tags #2979

Merged
merged 1 commit into from
Jan 23, 2017
Merged

tpl: Improve generation of OpenGraph date tags #2979

merged 1 commit into from
Jan 23, 2017

Conversation

alanorth
Copy link
Contributor

@alanorth alanorth commented Jan 22, 2017

Three major improvements. From the commit message:

  • Allow all nodes/pages to use date-related OpenGraph meta tags, not only sites which are using the as-of-yet unfinished .Site.Authors functionality.
  • Improve compliance of tags with Facebook's OpenGraph docs for the "website" and "article" types[0][1]. Also, use the proper tag for modification date (og:update_time vs article:modified_time).
  • Generate date published using either .PublishDate or .Date, and use .Lastmod for modification date, which can use the new enableGitInfo functionality from Hugo 0.18, but seamlessly falls back to .Date if the site does not have this enabled/supported.

Tested on Facebook's OpenGraph debug tool and the new metadata is detected properly.

[0] https://developers.facebook.com/docs/reference/opengraph/object-type/website/
[1] https://developers.facebook.com/docs/reference/opengraph/object-type/article/

Allow all nodes/pages to use date-related OpenGraph meta tags, not
only sites which are using the as-of-yet unfinished .Site.Authors
functionality.

Improve compliance of tags with Facebook's OpenGraph docs for the
"website" and "article" types[0][1]. Also, use the proper tag for
modification date (og:update_time vs article:modified_time).

Generate date published using either .PublishDate or .Date, and use
.Lastmod for modification date, which can use the new enableGitInfo
functionality from Hugo 0.18, but seamlessly falls back to .Date if
the site does not have this enabled/supported.

[0] https://developers.facebook.com/docs/reference/opengraph/object-type/website/
[1] https://developers.facebook.com/docs/reference/opengraph/object-type/article/
@bep bep merged commit 95ad3ad into gohugoio:master Jan 23, 2017
@alanorth alanorth deleted the improve-opengraph-dates branch January 23, 2017 20:25
bep pushed a commit that referenced this pull request Feb 21, 2017
A previous commit greatly improved the OpenGraph tags generated by
Hugo's internal opengraph template, but there was a minor error in
the fix. Nodes are of type "website" and according to the Facebook
docs they should use og:updated_time.

See: #2979
See: https://developers.facebook.com/docs/reference/opengraph/object-type/website/
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants