fixed regular expression for new_page rake task
This commit is contained in:
parent
3f2855ac6b
commit
cc1cfa56b2
2
Rakefile
2
Rakefile
@ -81,7 +81,7 @@ task :new_page, :filename do |t, args|
|
|||||||
require './plugins/titlecase.rb'
|
require './plugins/titlecase.rb'
|
||||||
args.with_defaults(:filename => 'new-page')
|
args.with_defaults(:filename => 'new-page')
|
||||||
page_dir = source_dir
|
page_dir = source_dir
|
||||||
if args.filename =~ /(^.+\/)?(\w+)(\.)?(.+)?/
|
if args.filename =~ /(^.+\/)?([\w_-]+)(\.)?(.+)?/
|
||||||
page_dir += $4 ? "/#{$1}" : "/#{$1}#{$2}/"
|
page_dir += $4 ? "/#{$1}" : "/#{$1}#{$2}/"
|
||||||
name = $4 ? $2 : "index"
|
name = $4 ? $2 : "index"
|
||||||
extension = $4 || "#{new_page_ext}"
|
extension = $4 || "#{new_page_ext}"
|
||||||
|
Loading…
Reference in New Issue
Block a user