-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor seo.html and support OpenGraph image overrides (#1321)
- Refactor seo.html include and add `page.header.og_image` override - DRY up handling of page images (`page.header.image`, `page.header.overlay_image`, `page.header.teaser`, and `site.og_image`). - Allow page images to be set with `header.og_image` page variable in YAML Front Matter as per feature request in #1316. - Add sample posts for testing `og_image` override - Set author bio as site OpenGraph default image - Document `page.header.og_image` OpenGraph override - Update CHANGELOG and history Close #1316
- Loading branch information
Showing
20 changed files
with
275 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: "Post: Header Image with OpenGraph Override" | ||
header: | ||
image: /assets/images/page-header-image.png | ||
og_image: /assets/images/page-header-og-image.png | ||
categories: | ||
- Layout | ||
- Uncategorized | ||
tags: | ||
- edge case | ||
- image | ||
- layout | ||
last_modified_at: 2017-10-26T15:12:19-04:00 | ||
--- | ||
|
||
This post has a header image with an OpenGraph override. | ||
|
||
```yaml | ||
header: | ||
image: /assets/images/page-header-image.png | ||
og_image: /assets/images/page-header-og-image.png | ||
``` |
Oops, something went wrong.
869a0e5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we previously had overlay_image, should we do a mass find/replace and set that for og_image?
Every post I have (that has a header image) basically duplicates the
image:
value by default from my page template, just in case I want them to be different.See example post
869a0e5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using
header.image
andheader.overlay_image
together? On that example page only the overlay image is shown so there's no need forheader.image
unless I'm missing something.The image used for OG and Twitter follows this order:
page.header.og_image
>page.header.overlay_image
>page.header.image
. Which mimics the behavior of what is shown on the page.If you don't want
header.overlay_image
used as the OG image and insteadheader.image
you can use YAML anchor and aliases like this to DRY it up.