mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-12 04:08:29 +01:00
homepage layout changes and more [wip draft]
- enable navbar for homepage - more navbar entries - lts-16 - drop /?page - [q] can hoogle be updated to 5.0.18? - improve /snapshots "buttons" - improve snapshot top matter - [q] better to use haskellstack.org ?
This commit is contained in:
parent
bfb01a7a92
commit
7bc469c5f3
@ -11,7 +11,6 @@ import Data.WebsiteContent
|
|||||||
import Settings
|
import Settings
|
||||||
import Settings.StaticFiles
|
import Settings.StaticFiles
|
||||||
import Stackage.Database
|
import Stackage.Database
|
||||||
import Text.Blaze
|
|
||||||
import Text.Hamlet (hamletFile)
|
import Text.Hamlet (hamletFile)
|
||||||
import Types
|
import Types
|
||||||
import Yesod.AtomFeed
|
import Yesod.AtomFeed
|
||||||
@ -68,7 +67,6 @@ defaultLayoutWithContainer insideContainer widget = do
|
|||||||
-- value passed to hamletToRepHtml cannot be a widget, this allows
|
-- value passed to hamletToRepHtml cannot be a widget, this allows
|
||||||
-- you to use normal widget features in default-layout.
|
-- you to use normal widget features in default-layout.
|
||||||
|
|
||||||
cur <- getCurrentRoute
|
|
||||||
pc <- widgetToPageContent $ do
|
pc <- widgetToPageContent $ do
|
||||||
$(combineStylesheets 'StaticR
|
$(combineStylesheets 'StaticR
|
||||||
[ css_normalize_css
|
[ css_normalize_css
|
||||||
@ -146,13 +144,6 @@ instance Yesod App where
|
|||||||
|
|
||||||
maximumContentLength _ _ = Just 2000000
|
maximumContentLength _ _ = Just 2000000
|
||||||
|
|
||||||
instance ToMarkup (Route App) where
|
|
||||||
toMarkup c =
|
|
||||||
case c of
|
|
||||||
AllSnapshotsR{} -> "Snapshots"
|
|
||||||
BlogHomeR -> "Blog"
|
|
||||||
_ -> ""
|
|
||||||
|
|
||||||
-- This instance is required to use forms. You can modify renderMessage to
|
-- This instance is required to use forms. You can modify renderMessage to
|
||||||
-- achieve customized and internationalized form validation messages.
|
-- achieve customized and internationalized form validation messages.
|
||||||
instance RenderMessage App FormMessage where
|
instance RenderMessage App FormMessage where
|
||||||
|
|||||||
@ -30,12 +30,8 @@ getHomeR :: Handler Html
|
|||||||
getHomeR = track "Handler.Snapshots.getAllSnapshotsR" $ do
|
getHomeR = track "Handler.Snapshots.getAllSnapshotsR" $ do
|
||||||
cacheSeconds $ 60 * 60
|
cacheSeconds $ 60 * 60
|
||||||
now' <- getCurrentTime
|
now' <- getCurrentTime
|
||||||
currentPageMay <- lookupGetParam "page"
|
|
||||||
let currentPage :: Int
|
|
||||||
currentPage = fromMaybe 1 (currentPageMay >>= readMay)
|
|
||||||
(map entityVal -> snapshots) <-
|
(map entityVal -> snapshots) <-
|
||||||
getSnapshots Nothing snapshotsPerPage
|
getSnapshots Nothing snapshotsPerPage 0
|
||||||
((fromIntegral currentPage - 1) * snapshotsPerPage)
|
|
||||||
let groups = groupUp now' snapshots
|
let groups = groupUp now' snapshots
|
||||||
latestLtsNameWithHoogle <- getLatestLtsNameWithHoogle
|
latestLtsNameWithHoogle <- getLatestLtsNameWithHoogle
|
||||||
latestLtsByGhc <- getLatestLtsByGhc
|
latestLtsByGhc <- getLatestLtsByGhc
|
||||||
|
|||||||
@ -15,7 +15,6 @@ module Stackage.Database.Cron
|
|||||||
|
|
||||||
import Conduit
|
import Conduit
|
||||||
import Control.DeepSeq
|
import Control.DeepSeq
|
||||||
import Control.Lens ((.~))
|
|
||||||
import qualified Control.Monad.Trans.AWS as AWS (paginate)
|
import qualified Control.Monad.Trans.AWS as AWS (paginate)
|
||||||
import Control.SingleRun
|
import Control.SingleRun
|
||||||
import qualified Data.ByteString.Char8 as BS8
|
import qualified Data.ByteString.Char8 as BS8
|
||||||
@ -800,6 +799,3 @@ pathToPackageModule txt =
|
|||||||
pkgId :: PackageIdentifierP <- fromPathPiece pkgIdentifier
|
pkgId :: PackageIdentifierP <- fromPathPiece pkgIdentifier
|
||||||
Just (pkgId, modName)
|
Just (pkgId, modName)
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
resolver: lts-15.6
|
resolver: lts-16.20
|
||||||
extra-deps:
|
extra-deps:
|
||||||
- barrier-0.1.1@sha256:2021f84c3aba67bb635d72825d3bc0371942444dc014bc307b875071e29eea98,3931
|
- barrier-0.1.1@sha256:2021f84c3aba67bb635d72825d3bc0371942444dc014bc307b875071e29eea98,3931
|
||||||
- hackage-security-0.6.0.0@sha256:69987d46e7b55fe5f0fc537021c3873c5f6f44a6665d349ee6995fd593df8147,11976
|
- hackage-security-0.6.0.1
|
||||||
- hoogle-5.0.17.14@sha256:a35eab4f833cd131f1abc79360e3bdbc5aecd7526b9a530ac606580e18691e2b,3173
|
- hoogle-5.0.17.14@sha256:a35eab4f833cd131f1abc79360e3bdbc5aecd7526b9a530ac606580e18691e2b,3173
|
||||||
- hpack-0.33.0@sha256:ca82f630abe0fba199aa05dcc9942ee8bf137e1425049a7a9ac8458c82d9dcc9,4406
|
|
||||||
- yesod-gitrepo-0.3.0@sha256:7aad996935065726ce615c395d735cc01dcef3993b1788f670f6bfc866085e02,1191
|
- yesod-gitrepo-0.3.0@sha256:7aad996935065726ce615c395d735cc01dcef3993b1788f670f6bfc866085e02,1191
|
||||||
- lukko-0.1.1.1@sha256:5c674bdd8a06b926ba55d872abe254155ed49a58df202b4d842b643e5ed6bcc9,4289
|
|
||||||
- github: commercialhaskell/pantry
|
- github: commercialhaskell/pantry
|
||||||
commit: c4e7c3dff9770e7937c93edfb6564dd6a1acd55e
|
commit: c4e7c3dff9770e7937c93edfb6564dd6a1acd55e
|
||||||
- github: fpco/casa
|
- github: fpco/casa
|
||||||
|
|||||||
@ -1,17 +1,15 @@
|
|||||||
<div class="navbar navbar-inverse navbar-static-top">
|
<div class="navbar navbar-inverse navbar-static-top">
|
||||||
<div class="navbar-inner">
|
<div class="navbar-inner">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
|
||||||
<span class="icon-bar">
|
|
||||||
<span class="icon-bar">
|
|
||||||
<span class="icon-bar">
|
|
||||||
<a class="brand" href="/">
|
<a class="brand" href="/">
|
||||||
<img src="/static/img/stackage.png" title="FP Complete">
|
<img src="/static/img/stackage.png" title="Stackage">
|
||||||
<div class="nav-collapse collapse">
|
<div class="nav-collapse collapse">
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
$forall route <- [AllSnapshotsR, BlogHomeR]
|
<li> <a href="/#about">about</a>
|
||||||
<li :Just route == cur:.active>
|
<li> <a href="/lts">LTS</a>
|
||||||
<a href=@{route}>#{route}
|
<li> <a href="/nightly">Nightly</a>
|
||||||
|
<li> <a href="/snapshots">Snapshots</a>
|
||||||
|
<li> <a href="/blog">Blog</a>
|
||||||
|
|
||||||
$maybe msg <- mmsg
|
$maybe msg <- mmsg
|
||||||
<div .container>
|
<div .container>
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
<div .container>
|
<div .container>
|
||||||
<div .row .header>
|
<div .row .header>
|
||||||
<div .span6>
|
<div .span4>
|
||||||
<img src=@{StaticR img_logo_png} .logo>
|
<img src=@{StaticR img_logo_png} .logo>
|
||||||
<div .span6>
|
<h4><a href="#about">Stable Haskell package sets
|
||||||
|
<div .span3>
|
||||||
<form class="hoogle" action="/#{latestLtsNameWithHoogle}/hoogle">
|
<form class="hoogle" action="/#{latestLtsNameWithHoogle}/hoogle">
|
||||||
<div class="input-append hoogle-q">
|
<div class="input-append hoogle-q">
|
||||||
<input class="search span3" type="search" autofocus="" name="q" value="" placeholder="E.g. map, a -> a, etc.">
|
<input class="search span3" type="search" autofocus="" name="q" value="" placeholder="E.g. map, a -> a, etc.">
|
||||||
@ -17,90 +18,56 @@
|
|||||||
Exact lookup
|
Exact lookup
|
||||||
|
|
||||||
<div .row>
|
<div .row>
|
||||||
<div .span12>
|
<div .span6>
|
||||||
<p>
|
<h4><a href="blog">Recent News</a>
|
||||||
Stackage is a stable source of Haskell packages. It guarantees that packages build consistently and pass tests before generating nightly and Long Term Support (LTS) releases.
|
$maybe post <- mrecentBlog
|
||||||
<p>
|
<p>
|
||||||
A Stackage snapshot includes pinned package versions from <a href="https://hackage.haskell.org">Hackage</a> (the index of all Haskell packages in all versions).
|
<a href=@{BlogPostR (postYear post) (postMonth post) (postSlug post)}>#{postTitle post}</a>,
|
||||||
It is a curated set of packages that work well together, similar to how a <a href="https://www.debian.org">Debian</a> release is a curated snapshot of most of the open-source software in the world.
|
<abbr title=#{show $ postTime post}>#{dateDiff now' (utctDay $ postTime post)}</abbr>
|
||||||
<p>
|
|
||||||
<a href="https://haskellstack.org">Stack</a> is a tool made specifically to make using Stackage snapshots easy and convenient.
|
|
||||||
We recommend you to use it.
|
|
||||||
But you can also use Stackage in other ways: as a source for packages that work well together, or to ensure that Haskell packages you author or care about work well with others.
|
|
||||||
<p>
|
|
||||||
Stackage is a community project: Haskell users around the world work together to create the stable snapshots.
|
|
||||||
<br />
|
|
||||||
Stackage itself and all tools surrounding it are open-source.
|
|
||||||
<p>
|
|
||||||
Stackage's infrastructure, build machines, initial creation and ongoing maintenance, are proudly sponsored by <a href="https://www.fpcomplete.com">FP Complete</a>.
|
|
||||||
|
|
||||||
<div .row>
|
<div .row>
|
||||||
<div .span6>
|
<div .span6>
|
||||||
<h3>
|
<h3>
|
||||||
Latest releases
|
Latest LTS release per GHC version
|
||||||
|
|
||||||
<p>
|
|
||||||
You browse the latest long term support (#
|
|
||||||
<a href="https://github.com/fpco/lts-haskell#readme">what are Long Term Support releases?#
|
|
||||||
) release, or the latest
|
|
||||||
bleeding-edge nightly release.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<a href="/lts">
|
|
||||||
LTS Haskell
|
|
||||||
<p>
|
|
||||||
<a href="/nightly">
|
|
||||||
Stackage Nightly
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Have more questions? We have a #
|
|
||||||
<a href="https://github.com/fpco/stackage#frequently-asked-questions">FAQ section on Github#
|
|
||||||
\.
|
|
||||||
<h3>
|
|
||||||
Related initiatives
|
|
||||||
<p>
|
|
||||||
Stack is the recommended way to use Stackage.
|
|
||||||
<p>
|
|
||||||
<a href="https://haskell.fpcomplete.com/get-started">
|
|
||||||
Get started with Stack
|
|
||||||
on
|
|
||||||
<a href="https://haskell.fpcomplete.com/">#
|
|
||||||
haskell.fpcomplete.com#
|
|
||||||
\.
|
|
||||||
|
|
||||||
<h3>
|
|
||||||
Latest LTS per GHC version
|
|
||||||
<ul>
|
<ul>
|
||||||
$forall (major, minor, ghc, date) <- latestLtsByGhc
|
$forall (major, minor, ghc, date) <- latestLtsByGhc
|
||||||
<li>
|
<li>
|
||||||
<a href=@{SnapshotR (SNLts major minor) StackageHomeR}>LTS #{major}.#{minor} for #{ghc}#
|
<a href=@{SnapshotR (SNLts major minor) StackageHomeR}>LTS #{major}.#{minor} for #{ghc}#
|
||||||
\, published #{dateDiff now' date}
|
\, published #{dateDiff now' date}
|
||||||
<h3>
|
|
||||||
Package Maintainers
|
|
||||||
<p>
|
|
||||||
<a href="https://github.com/fpco/stackage/blob/master/MAINTAINERS.md#adding-a-package">
|
|
||||||
Add your maintained packages to stackage
|
|
||||||
|
|
||||||
<div .span6>
|
<div .span6>
|
||||||
<h3>News
|
<h3>Recent Snapshots
|
||||||
$maybe post <- mrecentBlog
|
$forall stackages <- groups
|
||||||
|
<ul .snapshots>
|
||||||
|
$forall (ident, title, uploaded) <- stackages
|
||||||
|
<li>
|
||||||
|
<strong>
|
||||||
|
<a href=@{SnapshotR ident StackageHomeR}>#{title}</a>, #{uploaded}
|
||||||
|
<p>
|
||||||
|
<a href=@{AllSnapshotsR}>
|
||||||
|
Snapshots archive
|
||||||
|
|
||||||
|
<div .row>
|
||||||
|
<div .span6>
|
||||||
|
<h3 id="about">
|
||||||
|
About Stackage
|
||||||
<p>
|
<p>
|
||||||
<a href=@{BlogPostR (postYear post) (postMonth post) (postSlug post)}>#{postTitle post}
|
Stackage provides consistent sets of Haskell packages, known to build together and pass their tests before becoming <a href="/nightly">Stackage Nightly</a> snapshots and <a href="/lts">LTS</a>
|
||||||
|
(<a href="https://github.com/fpco/lts-haskell#readme">Long Term Support</a>) releases.
|
||||||
<p>
|
<p>
|
||||||
<abbr title=#{show $ postTime post}>#{dateDiff now' (utctDay $ postTime post)}
|
It is a distribution of a subset packages from <a href="https://hackage.haskell.org">Hackage</a>, each package chosen at a version to make the set self-consistent. Note that Stackage does not patch any packages.
|
||||||
$nothing
|
<p>
|
||||||
<a href="/blog">Blog
|
We recommend using the <a href="https://haskellstack.org">stack</a> tool, which makes using Stackage snapshots easy and convenient.
|
||||||
<h3>Snapshots
|
But Stackage can also be used in other ways: as a source of consistent packages that work well together, or to ensure that Haskell packages you author or care about work well with others.
|
||||||
$forall stackages <- groups
|
<a href="https://haskell.fpcomplete.com/get-started">Get started with Stack</a>
|
||||||
$forall (_, _, uploaded) <- take 1 stackages
|
<p>
|
||||||
<h5>
|
Stackage is a community project: Haskell users around the world work together to keep Stackage snapshots up to date with recent package versions:
|
||||||
#{uploaded}
|
Stackage itself and all the tools surrounding it are open-source.
|
||||||
<ul .snapshots>
|
See <a href="https://github.com/fpco/stackage/blob/master/MAINTAINERS.md#adding-a-package">
|
||||||
$forall (ident, title, _uploaded) <- stackages
|
<b>how to add packages to Stackage</b></a>
|
||||||
<li>
|
<p>
|
||||||
<strong>
|
Have more questions? We have a #
|
||||||
<a href=@{SnapshotR ident StackageHomeR}>
|
<a href="https://github.com/fpco/stackage#frequently-asked-questions">FAQ section on Github</a>.
|
||||||
#{title}
|
|
||||||
<p>
|
<p>
|
||||||
<a href=@{AllSnapshotsR}>
|
Stackage's infrastructure, build machines, initial creation and ongoing maintenance, are proudly sponsored by <a href="https://www.fpcomplete.com">FP Complete</a>.
|
||||||
Snapshots archive
|
|
||||||
|
|||||||
@ -1,10 +1,5 @@
|
|||||||
.navbar {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.logo {
|
.logo {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
.header {
|
.header {
|
||||||
margin-bottom: 1em;
|
|
||||||
margin-top: 2em;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,10 @@
|
|||||||
<div .snapshot-nav>
|
<div .snapshot-nav>
|
||||||
$if isFirstPage
|
$if not isFirstPage
|
||||||
at newest --
|
|
||||||
$else
|
|
||||||
<a href=@{AllSnapshotsR}?page=#{currentPage - 1}>
|
<a href=@{AllSnapshotsR}?page=#{currentPage - 1}>
|
||||||
see newer --
|
\< newer
|
||||||
|
<span .separator>
|
||||||
\ Page #{currentPage} #
|
\ Page #{currentPage} #
|
||||||
$if isLastPage
|
$if not isLastPage
|
||||||
++ at oldest
|
<span .separator>
|
||||||
$else
|
|
||||||
<a href=@{AllSnapshotsR}?page=#{currentPage + 1}>
|
<a href=@{AllSnapshotsR}?page=#{currentPage + 1}>
|
||||||
++ see older
|
older \>
|
||||||
|
|||||||
@ -7,19 +7,14 @@ $newline never
|
|||||||
<span .separator>
|
<span .separator>
|
||||||
<span>
|
<span>
|
||||||
<a href=@{StackageDiffR previousSnapName name}>View changes
|
<a href=@{StackageDiffR previousSnapName name}>View changes
|
||||||
<span .separator>
|
|
||||||
<span>
|
|
||||||
stack #
|
|
||||||
<code>resolver: #{toPathPiece name}
|
|
||||||
<h3>Setup guide
|
|
||||||
|
|
||||||
<p>Edit your stack.yaml and set the following:
|
<p>To use this resolver:
|
||||||
<p .stack-resolver-yaml>resolver: #{toPathPiece name}
|
<p>edit your stack.yaml and set the following:
|
||||||
<p>You can also use <code>stack --resolver #{toPathPiece name}</code> on the command line
|
<p .stack-resolver-yaml>resolver: #{toPathPiece name}
|
||||||
|
<p>or on the command line use:
|
||||||
|
<code>stack --resolver #{toPathPiece name}</code>
|
||||||
|
|
||||||
<p>
|
<p>For more details see <a href="http://docs.haskellstack.org">the stack homepage</a>
|
||||||
<b>New to stack?
|
|
||||||
\ Check out <a href="http://docs.haskellstack.org">the stack homepage</a>
|
|
||||||
|
|
||||||
<h3>Hoogle
|
<h3>Hoogle
|
||||||
^{hoogleForm}
|
^{hoogleForm}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user