-
Notifications
You must be signed in to change notification settings - Fork 298
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
Add og:locale support #166
Conversation
Addresses #167 |
Is there a pattern for what the key should be called? Can we use |
@benbalter It is not a standard config in Jekyll (it was in Octopress), but I’m absolutely game to piggyback on |
@benbalter Made the changes & merged back your |
@@ -7,4 +7,5 @@ | |||
/pkg/ | |||
/spec/reports/ | |||
/tmp/ | |||
/bin/ |
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.
What is this?
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.
I was following the RSpec install recommendation which created that directory. I didn’t want to bundle it with the repo.
README.md
Outdated
The SEO tag will respect the following YAML front matter if included in a post, page, or document: | ||
|
||
* `title` - The title of the post, page, or document | ||
* `description` - A short description of the page's content | ||
* `image` - URL to an image associated with the post, page, or document (e.g., `/assets/page-pic.jpg`) | ||
* `author` - Page-, post-, or document-specific author information (see below) | ||
* `locale` - Page-, post-, or document-specific language information |
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.
This will need to be lang
. We should also indicate that this can be site.lang
.
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.
Yes. Fix coming. Sorry I missed that.
README.md
Outdated
The SEO tag will respect the following YAML front matter if included in a post, page, or document: | ||
|
||
* `title` - The title of the post, page, or document | ||
* `description` - A short description of the page's content | ||
* `image` - URL to an image associated with the post, page, or document (e.g., `/assets/page-pic.jpg`) | ||
* `author` - Page-, post-, or document-specific author information (see below) | ||
* `locale` - Page-, post-, or document-specific language information |
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.
This should be changed to lang
, correct?
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.
Yep.
lib/template.html
Outdated
@@ -97,6 +97,8 @@ | |||
{% assign seo_page_image = seo_page_image | escape %} | |||
{% endif %} | |||
|
|||
{% assign seo_page_locale = page.lang | default: site.lang | default: "en_US"" %} |
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.
Is there a reason we need to default to "en_US"
instead of just not setting anything if the user didn't ask for it?
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.
Can we instead call this seo_page_lang
for consistency?
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.
Yes we can.
The OG docs default to “en_US”. I thought it made sense to be explicit. If you feel otherwise, we can drop the tag without a defined language (or even if it is “en_US”).
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.
LGTM
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.
Thanks for all the work you put into this 👍🍻
@@ -97,6 +97,8 @@ | |||
{% assign seo_page_image = seo_page_image | escape %} | |||
{% endif %} | |||
|
|||
{% assign seo_page_lang = page.lang | default: site.lang | default: "en_US" %} |
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.
I don't know about default values here, but I suppose I don't have a strong preference either way.
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.
Should there be some sort of string normalization applied with maybe a | replace: '-', '_'
?
For example it's possible to have a site.lang
of en-US
for the lang
attribute in <html lang="...">
. Same for xml:lang
in an Atom feed <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="...">
.
In both cases it appears they expect values of language-REGION, e.g. en-US
, where as og:locale
wants en_US
with an underscore.
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.
Good call. I can make that happen.
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.
And done (assuming I didn’t do anything to annoy Rubocop).
Nice work @aarongustafson! 🌐 🎏 🈂️ |
Yay! Any idea when the next release will be? |
If #151 lands soon, it'd be a solid release to get that in. |
No description provided.