Skip to content

feat(helper/is): add is_home_first_page() helper#5006

Merged
SukkaW merged 2 commits intohexojs:masterfrom
renbaoshuo:is-index
Jun 30, 2022
Merged

feat(helper/is): add is_home_first_page() helper#5006
SukkaW merged 2 commits intohexojs:masterfrom
renbaoshuo:is-index

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.

@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