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

feat(open_graph): drop 'keywords' option from front-matter #4174

Merged
merged 4 commits into from
Jun 21, 2020

Conversation

curbengh
Copy link
Contributor

@curbengh curbengh commented Mar 6, 2020

What does it do?

breaking change, keywords option is dropped from front-matter.

keywords value is added as article:tag meta tag, same as tags value. So, the option is duplicate of tags option in a post's front-matter.

Currently, page.keywords takes precedent over page.tags. To avoid confusion, we should drop page.keywords.

However, keywords can also be specified in site config, which makes it behave like global tags, meaning it will be added to every post's article:tag meta tag, if the post doesn't have a tag. So, config.keywords is still retained.

Previously, there was keywords meta tag in which its value is comma-separated string.

But that tag has been deprecated and replaced by article:tag meta tag in #3805, which is specified one-by-one.

After #3805, as a side effect, open_graph ends up supporting tags and config.keywords in comma-separated string and array types and can lead to confusion (hexojs/site#1288 hexojs/site#1286).

This PR drops support of comma-separated string so that it's consistent with categories.

tags and config.keywords still supports string, but only for single value. It will be converted to a single-element array. e.g. 'foo' -> [ 'foo' ].

How to test

git clone -b og-keywords-drop-string https://github.com/curbengh/hexo.git
cd hexo
npm install
npm test

Screenshots

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

@curbengh curbengh added this to the 5.0.0 milestone Mar 6, 2020
@curbengh curbengh changed the title feat(open_graph): keywords option must be in array feat(open_graph): drop 'keywords' option from front-matter Mar 6, 2020
@noraj noraj mentioned this pull request May 4, 2020
22 tasks
curbengh added 4 commits June 20, 2020 09:05
BREAKING CHANGE: keywords no longer support comma-separated string
BREAKING CHANGE: drop keywords option from front-matter
keywords option in site config is still supported
@curbengh curbengh force-pushed the og-keywords-drop-string branch from 8cef984 to 7f7c571 Compare June 20, 2020 08:08
@coveralls
Copy link

coveralls commented Jun 20, 2020

Coverage Status

Coverage remained the same at 97.816% when pulling 7f7c571 on curbengh:og-keywords-drop-string into d327789 on hexojs:master.

Copy link
Member

@SukkaW SukkaW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I think it is ready for review now.

@curbengh curbengh marked this pull request as ready for review June 20, 2020 08:40
@curbengh curbengh merged commit 70ad7e6 into hexojs:master Jun 21, 2020
@curbengh curbengh deleted the og-keywords-drop-string branch June 21, 2020 04:57
@SukkaW SukkaW mentioned this pull request Jul 16, 2020
22 tasks
curbengh added a commit to curbengh/hexo-theme-light that referenced this pull request Aug 9, 2020
curbengh added a commit to curbengh/hexo-theme-phase that referenced this pull request Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants