Skip to content

Commit

Permalink
Backport #7908 for v4.0.x (#8142)
Browse files Browse the repository at this point in the history
Add static file's basename to its url_placeholder
This backports be70c3e to 4.0-stable
  • Loading branch information
ashmaroli committed Apr 26, 2020
2 parents 3014f8d + 830c1e6 commit 4c124cc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions features/collections.feature
Expand Up @@ -610,3 +610,17 @@ Feature: Collections
And I should see "Thanksgiving Black Friday" in "_site/index.html"
And I should see "Happy Thanksgiving" in "_site/thanksgiving/2015-11-26-thanksgiving.html"
And I should see "Black Friday" in "_site/thanksgiving/black-friday.html"

Scenario: Rendered collection with custom permalinks and static file contents
Given I have fixture collections
And I have a "_config.yml" file with content:
"""
collections:
methods:
output: true
permalink: /:collection/:name
"""
When I run jekyll build
Then I should get a zero exit status
And the _site directory should exist
And I should see "I have no front matter." in "_site/methods/extensionless_static_file"
2 changes: 1 addition & 1 deletion lib/jekyll/static_file.rb
Expand Up @@ -126,7 +126,7 @@ def placeholders
:collection => @collection.label,
:path => cleaned_relative_path,
:output_ext => "",
:name => "",
:name => basename,
:title => "",
}
end
Expand Down
1 change: 1 addition & 0 deletions test/source/_methods/extensionless_static_file
@@ -0,0 +1 @@
I have no front matter.

0 comments on commit 4c124cc

Please sign in to comment.