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(helper/is): add is_home_first_page() helper #5006

Merged
merged 2 commits into from
Jun 30, 2022

Conversation

renbaoshuo
Copy link
Member

@renbaoshuo renbaoshuo commented Jun 23, 2022

What does it do?

Added a new helper called is_index() is_home_first_page(). This helper will detect whether the page is a page generated by hexo-generator-index and the page number is 1.

In fact, I thought the functions of is_home() and is_index() should be swapped, but that would break the existing page, so I created a new helper.

Screenshots

None.

Pull request tasks

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

@github-actions
Copy link

How to test

git clone -b is-index https://github.com/renbaoshuo/hexo.git
cd hexo
npm install
npm test

@coveralls
Copy link

coveralls commented Jun 23, 2022

Coverage Status

Coverage increased (+0.002%) to 98.008% when pulling 9d5d679 on renbaoshuo:is-index into 24db105 on hexojs:master.

lib/plugins/helper/is.js Outdated Show resolved Hide resolved
@renbaoshuo renbaoshuo changed the title feat(helper/is): add is_index() helper feat(helper/is): add is_home_first_page() helper Jun 23, 2022
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.

3 participants