Warn on command-line with permalink conflict (#8342)
Merge pull request 8342
This commit is contained in:
		
							parent
							
								
									9a7955d9b3
								
							
						
					
					
						commit
						a4f5b850af
					
				|  | @ -142,3 +142,12 @@ Feature: Fancy permalinks | ||||||
|     And the _site directory should exist |     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 PHP" in "_site/2016/i-am-php.php" | ||||||
|     And I should see "I am also PHP" in "_site/i-am-also-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 | ||||||
|  |  | ||||||
|  | @ -221,6 +221,7 @@ module Jekyll | ||||||
|     # |     # | ||||||
|     # Returns nothing. |     # Returns nothing. | ||||||
|     def write |     def write | ||||||
|  |       Jekyll::Commands::Doctor.conflicting_urls(self) | ||||||
|       each_site_file do |item| |       each_site_file do |item| | ||||||
|         item.write(dest) if regenerator.regenerate?(item) |         item.write(dest) if regenerator.regenerate?(item) | ||||||
|       end |       end | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue