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

fix(helpers): call url_for from hexo-util #4447

Merged
merged 1 commit into from
Jul 30, 2020
Merged

Conversation

curbengh
Copy link
Contributor

@curbengh curbengh commented Jul 27, 2020

What does it do?

const css = hexo.extend.helper.get('css').bind(hexo)
const css = hexo.extend.helper.get('css')

doesn't work for me, somehow url_for() is not available in the hexo context. I tried v4.0.0, v4.1.1, v4.2.1 & v5 in Node 12.18

How to test

git clone -b url_for 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.

@coveralls
Copy link

coveralls commented Jul 27, 2020

Coverage Status

Coverage increased (+0.003%) to 98.239% when pulling 0fb3e31 on curbengh:url_for into 1489074 on hexojs:master.

@curbengh curbengh marked this pull request as ready for review July 27, 2020 15:20
SukkaW
SukkaW previously approved these changes Jul 27, 2020
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.

Should we replace all this.url_for in helpers?

@curbengh curbengh marked this pull request as draft July 28, 2020 01:33
@curbengh
Copy link
Contributor Author

curbengh commented Jul 28, 2020

Should we replace all this.url_for in helpers?

we should. updating PR... (Edit) done

hexo.extend.helper.get('css').bind(hexo) or hexo.extend.helper.get('css') also don't work for you?

@curbengh curbengh marked this pull request as ready for review July 29, 2020 04:45
@curbengh curbengh changed the title fix(helpers/css&js): call url_for from hexo-util fix(helpers): call url_for from hexo-util Jul 29, 2020
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!

Anyway, is there any this.full_url_for exists as well? If so, it could be replaced as well.

@curbengh
Copy link
Contributor Author

Anyway, is there any this.full_url_for exists as well?

That's all I found with vscode.

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!

@curbengh curbengh merged commit 0aac5d6 into hexojs:master Jul 30, 2020
@curbengh curbengh deleted the url_for branch July 30, 2020 00:33
@curbengh curbengh mentioned this pull request Aug 10, 2020
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.

4 participants