Allow Jekyll Doctor to detect stray posts dir (#6681)

Merge pull request 6681
This commit is contained in:
ashmaroli 2018-02-20 20:12:45 +05:30 committed by jekyllbot
parent 2b77ee80e0
commit cef66defbd
1 changed files with 13 additions and 0 deletions

View File

@ -41,9 +41,22 @@ module Jekyll
!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:",
"Detected '_posts' directory outside custom `collections_dir`!"
Jekyll.logger.warn "",
"Please move '#{posts_at_root}' into the custom directory at " \
"'#{site.in_source_dir(site.config["collections_dir"])}'"
false
end
def deprecated_relative_permalinks(site)
if site.config["relative_permalinks"]
Jekyll::Deprecator.deprecation_message "Your site still uses relative" \