Skip to content

Commit

Permalink
Add static file's basename to its url_placeholder (#7908)
Browse files Browse the repository at this point in the history
Merge pull request 7908
  • Loading branch information
ashmaroli committed Apr 13, 2020
1 parent 2c605bf commit be70c3e
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 @@ -128,7 +128,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 be70c3e

Please sign in to comment.