Add redirect to index page if path ends in /
This commit is contained in:
+4
-1
@@ -625,7 +625,10 @@ module Precious
|
||||
|
||||
def show_page_or_file(fullpath)
|
||||
wiki = wiki_new
|
||||
if page = wiki.page(fullpath)
|
||||
if page = fullpath[-1] != '/' ? wiki.page("#{fullpath}/#{wiki.index_page}") : false
|
||||
redirect_path = "#{fullpath}/#{wiki.index_page}"
|
||||
redirect to("#{encodeURIComponent(redirect_path)}")
|
||||
elsif page = wiki.page(fullpath)
|
||||
@page = page
|
||||
@name = page.filename_stripped
|
||||
@content = page.formatted_data
|
||||
|
||||
Reference in New Issue
Block a user