Warn on command-line with permalink conflict (#8342)

Merge pull request 8342
This commit is contained in:
Seeker 2020-08-16 03:48:19 -07:00 committed by GitHub
parent 9a7955d9b3
commit a4f5b850af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -142,3 +142,12 @@ Feature: Fancy permalinks
And the _site directory should exist
And I should see "I am PHP" in "_site/2016/i-am-php.php"
And I should see "I am also PHP" in "_site/i-am-also-php.php"
Scenario: Use the same permalink twice
Given I have a "cool.md" page with permalink "/amazing.html" that contains "I am cool"
And I have an "awesome.md" page with permalink "/amazing.html" that contains "I am also awesome"
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "Conflict: The URL '" in the build output
And I should see "amazing.html' is the destination for the following pages: awesome.md, cool.md" in the build output

View File

@ -221,6 +221,7 @@ module Jekyll
#
# Returns nothing.
def write
Jekyll::Commands::Doctor.conflicting_urls(self)
each_site_file do |item|
item.write(dest) if regenerator.regenerate?(item)
end