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

Allow Jekyll Doctor to detect stray posts dir #6681

Merged
merged 2 commits into from
Feb 20, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/jekyll/commands/doctor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,20 @@ def healthy?(site)
!conflicting_urls(site),
!urls_only_differ_by_case(site),
proper_site_url?(site),
properly_gathered_posts?(site),
].all?
end

def properly_gathered_posts?(site)
return true if site.config["collections_dir"].empty?
posts_at_root = site.in_source_dir("_posts")
return true unless File.directory?(posts_at_root)
Jekyll.logger.warn "Warning:", "Contents of #{posts_at_root} will not be " \
"processed since you have specified a custom directory " \
"to house all collections."
Copy link
Member

@DirtyF DirtyF Jan 7, 2018

Choose a reason for hiding this comment

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

Could we rater display the awaited action from the user?

Warning: Custom collection_dir detected : move the _posts directory inside the my_collections directory. (where my_collections is the option set by the user)

false
end

def deprecated_relative_permalinks(site)
if site.config["relative_permalinks"]
Jekyll::Deprecator.deprecation_message "Your site still uses relative" \
Expand Down