Allow Jekyll Doctor to detect stray posts dir (#6681)
Merge pull request 6681
This commit is contained in:
parent
2b77ee80e0
commit
cef66defbd
|
@ -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" \
|
||||
|
|
Loading…
Reference in New Issue