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
Merged

handle sites with no posts #107

merged 3 commits into from
Nov 17, 2019

Conversation

tomap
Copy link
Contributor

@tomap 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
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
Copy link

Coverage Status

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

@tomap
Copy link
Contributor Author

tomap commented Nov 16, 2019

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

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.

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
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 November 17, 2019 05:30
@curbengh
Copy link
Contributor

hexo-generator-sitemap may need this as well.

Copy link
Contributor

@curbengh curbengh left a comment

Choose a reason for hiding this comment

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

Tested in local machine.

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