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

handle sites with no posts #107

Merged
merged 3 commits into from Nov 17, 2019

Conversation

@tomap
Copy link
Contributor

tomap commented Nov 16, 2019

see tomap/hexo-theme-minidyne-demo@2ddea21

The fix is a bit dumb, but I don't feel we need to generate an empty atom or rss file in that case.

Related to issue #43 (last comments)

@coveralls

This comment has been minimized.

Copy link

coveralls commented Nov 16, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling e8338a7 on tomap:fix/noPosts into 41a4505 on hexojs:master.

@coveralls

This comment has been minimized.

Copy link

coveralls commented Nov 16, 2019

Coverage Status

Coverage decreased (-2.4%) to 97.561% when pulling b4f7edd on tomap:fix/noPosts into 41a4505 on hexojs:master.

@tomap

This comment has been minimized.

Copy link
Contributor Author

tomap commented Nov 16, 2019

coverage decreased probably means I should add some tests...

Copy link
Member

SukkaW left a comment

The coverage ratio drops because of the increased LOC. Maybe you can add a test case about no post is given to cover that.

curbengh added 2 commits Nov 17, 2019
@curbengh

This comment has been minimized.

Copy link
Contributor

curbengh commented Nov 17, 2019

I've added the relevant unit test. autodiscovery will be disabled if no posts; the unit test couldn't test this because hexo.posts is not passed to autodiscovery(), it did work in my test blog.

@curbengh curbengh requested a review from SukkaW Nov 17, 2019
@curbengh

This comment has been minimized.

Copy link
Contributor

curbengh commented Nov 17, 2019

hexo-generator-sitemap may need this as well.

@SukkaW
SukkaW approved these changes Nov 17, 2019
Copy link
Contributor

curbengh left a comment

Tested in local machine.

@curbengh curbengh merged commit 8227043 into hexojs:master Nov 17, 2019
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
coverage/coveralls Coverage remained the same at 100.0%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.