diff --git a/features/permalinks.feature b/features/permalinks.feature index a69e059b..31c55105 100644 --- a/features/permalinks.feature +++ b/features/permalinks.feature @@ -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 diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 76c1327f..1647f8ad 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -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