1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00

Add test for #1718

This commit is contained in:
Thomas Reynolds 2016-01-10 16:56:18 -08:00
parent b4a6a503b3
commit 5cac6a1896
4 changed files with 6 additions and 2 deletions

View file

@ -9,6 +9,7 @@ Feature: Directory Index
| a_folder/needs_index/index.html |
| leave_me_alone.html |
| wildcard_leave_me_alone.html |
| regex_leave_me_alone2.html |
| evil spaces/index.html |
| regular/index.html |
| .htaccess |
@ -21,6 +22,7 @@ Feature: Directory Index
| a_folder/needs_index.html |
| leave_me_alone/index.html |
| wildcard_leave_me_alone/index.html |
| regex_leave_me_alone2/index.html |
And the file "needs_index/index.html" should contain "Indexable"
And the file "a_folder/needs_index/index.html" should contain "Indexable"
And the file "leave_me_alone.html" should contain "Stay away"

View file

@ -2,3 +2,4 @@ activate :directory_indexes
page "/leave_me_alone.html", directory_index: false
page "/wildcard*", directory_index: false
page /regex_.*/, directory_index: false

View file

@ -0,0 +1 @@
Stay away, wildcards!

View file

@ -44,7 +44,7 @@ module Middleman
# @option opts [Hash] locals Local variables for the template. These will be available when the template renders.
# @option opts [Hash] data Extra metadata to add to the page. This is the same as frontmatter, though frontmatter will take precedence over metadata defined here. Available via {Resource#data}.
# @return [void]
Contract String, Hash => Any
Contract Or[String, Regexp], Hash => Any
def page(path, opts={})
options = opts.dup