Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #397 from joehillen/_go-createPage

Create page if no match is found when using _go
  • Loading branch information...
commit d4d5420a9474ae84a6f438cc3c58b16728b16f9d 2 parents 0adeb2b + 1328545
@jgm authored
Showing with 2 additions and 6 deletions.
  1. +2 −6 Network/Gitit/Handlers.hs
View
8 Network/Gitit/Handlers.hs
@@ -242,7 +242,6 @@ goToPage = withData $ \(params :: Params) -> do
let findPage f = find f allPageNames
let exactMatch f = gotopage == f
let insensitiveMatch f = (map toLower gotopage) == (map toLower f)
- let prefixMatch f = (map toLower gotopage) `isPrefixOf` (map toLower f)
base' <- getWikiBase
case findPage exactMatch of
Just m -> seeOther (base' ++ urlForPage m) $ toResponse
@@ -250,11 +249,8 @@ goToPage = withData $ \(params :: Params) -> do
Nothing -> case findPage insensitiveMatch of
Just m -> seeOther (base' ++ urlForPage m) $ toResponse
"Redirecting to case-insensitive match"
- Nothing -> case findPage prefixMatch of
- Just m -> seeOther (base' ++ urlForPage m) $
- toResponse $ "Redirecting" ++
- " to partial match"
- Nothing -> searchResults
+ Nothing -> seeOther (base' ++ urlForPage gotopage) $ toResponse
+ "Redirecting to new page"
searchResults :: Handler
searchResults = withData $ \(params :: Params) -> do

0 comments on commit d4d5420

Please sign in to comment.
Something went wrong with that request. Please try again.