mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-11 19:58:28 +01:00
Make Hoogle URLs more consistent with other URLs
This commit is contained in:
parent
10e255c3cc
commit
0b7d1e4bd0
@ -9,6 +9,7 @@ import Data.Slug (Slug)
|
||||
import Handler.StackageHome (getStackageHomeR, getStackageMetadataR, getStackageCabalConfigR, getSnapshotPackagesR, getDocsR)
|
||||
import Handler.StackageIndex (getStackageIndexR, getStackageBundleR)
|
||||
import Handler.StackageSdist (getStackageSdistR)
|
||||
import Handler.Hoogle (getHoogleR)
|
||||
|
||||
handleAliasR :: Slug -> Slug -> [Text] -> Handler ()
|
||||
handleAliasR user name pieces = do
|
||||
@ -77,4 +78,5 @@ goSid sid pieces = do
|
||||
StackageSdistR pnv -> getStackageSdistR slug pnv >>= sendResponse
|
||||
SnapshotPackagesR -> getSnapshotPackagesR slug >>= sendResponse
|
||||
DocsR -> getDocsR slug >>= sendResponse
|
||||
HoogleR -> getHoogleR slug >>= sendResponse
|
||||
_ -> notFound
|
||||
|
||||
@ -46,7 +46,7 @@ getHoogleR slug = do
|
||||
}
|
||||
Nothing -> return $ HoogleQueryOutput "" [] Nothing
|
||||
let queryText = fromMaybe "" mquery
|
||||
pageLink p = (HoogleR slug
|
||||
pageLink p = (SnapshotR slug HoogleR
|
||||
, (if exact then (("exact", "true"):) else id)
|
||||
$ (maybe id (\q' -> (("q", q'):)) mquery)
|
||||
[("page", tshow p)])
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
/package/#PackageNameVersion StackageSdistR GET
|
||||
/packages SnapshotPackagesR GET
|
||||
/docs DocsR GET
|
||||
/hoogle HoogleR GET
|
||||
|
||||
/hackage-view/#HackageView/00-index.tar.gz HackageViewIndexR GET
|
||||
/hackage-view/#HackageView/package/#PackageNameVersion HackageViewSdistR GET
|
||||
@ -33,7 +34,6 @@
|
||||
/progress/#Int ProgressR GET
|
||||
/system SystemR GET
|
||||
/haddock/#SnapSlug/*Texts HaddockR GET
|
||||
/hoogle/#SnapSlug HoogleR GET
|
||||
/package/#PackageName PackageR GET
|
||||
/package/#PackageName/snapshots PackageSnapshotsR GET
|
||||
/package PackageListR GET
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<form .hoogle action=@{HoogleR slug}>
|
||||
<form .hoogle action=@{SnapshotR slug HoogleR}>
|
||||
<input type=search autofocus name=q value=#{queryText} placeholder="Hoogle Search Phrase" .search>
|
||||
<input .btn type="submit" value="Search">
|
||||
<label .checkbox .exact-lookup for=exact title="Only find identifiers matching your search term precisely">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user