diff --git a/src/Foundation.hs b/src/Foundation.hs index e4b244a..4bac6d6 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -11,7 +11,6 @@ import Data.WebsiteContent import Settings import Settings.StaticFiles import Stackage.Database -import Text.Blaze import Text.Hamlet (hamletFile) import Types import Yesod.AtomFeed @@ -68,7 +67,6 @@ defaultLayoutWithContainer insideContainer widget = do -- value passed to hamletToRepHtml cannot be a widget, this allows -- you to use normal widget features in default-layout. - cur <- getCurrentRoute pc <- widgetToPageContent $ do $(combineStylesheets 'StaticR [ css_normalize_css @@ -146,13 +144,6 @@ instance Yesod App where 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 -- achieve customized and internationalized form validation messages. instance RenderMessage App FormMessage where diff --git a/src/Handler/Home.hs b/src/Handler/Home.hs index 94efb1a..4abe9e9 100644 --- a/src/Handler/Home.hs +++ b/src/Handler/Home.hs @@ -30,12 +30,8 @@ getHomeR :: Handler Html getHomeR = track "Handler.Snapshots.getAllSnapshotsR" $ do cacheSeconds $ 60 * 60 now' <- getCurrentTime - currentPageMay <- lookupGetParam "page" - let currentPage :: Int - currentPage = fromMaybe 1 (currentPageMay >>= readMay) (map entityVal -> snapshots) <- - getSnapshots Nothing snapshotsPerPage - ((fromIntegral currentPage - 1) * snapshotsPerPage) + getSnapshots Nothing snapshotsPerPage 0 let groups = groupUp now' snapshots latestLtsNameWithHoogle <- getLatestLtsNameWithHoogle latestLtsByGhc <- getLatestLtsByGhc diff --git a/src/Stackage/Database/Cron.hs b/src/Stackage/Database/Cron.hs index fb0227b..7d41133 100644 --- a/src/Stackage/Database/Cron.hs +++ b/src/Stackage/Database/Cron.hs @@ -15,7 +15,6 @@ module Stackage.Database.Cron import Conduit import Control.DeepSeq -import Control.Lens ((.~)) import qualified Control.Monad.Trans.AWS as AWS (paginate) import Control.SingleRun import qualified Data.ByteString.Char8 as BS8 @@ -800,6 +799,3 @@ pathToPackageModule txt = pkgId :: PackageIdentifierP <- fromPathPiece pkgIdentifier Just (pkgId, modName) _ -> Nothing - - - diff --git a/stack.yaml b/stack.yaml index 57e34a1..36b834e 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,11 +1,9 @@ -resolver: lts-15.6 +resolver: lts-16.20 extra-deps: - 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 -- hpack-0.33.0@sha256:ca82f630abe0fba199aa05dcc9942ee8bf137e1425049a7a9ac8458c82d9dcc9,4406 - yesod-gitrepo-0.3.0@sha256:7aad996935065726ce615c395d735cc01dcef3993b1788f670f6bfc866085e02,1191 -- lukko-0.1.1.1@sha256:5c674bdd8a06b926ba55d872abe254155ed49a58df202b4d842b643e5ed6bcc9,4289 - github: commercialhaskell/pantry commit: c4e7c3dff9770e7937c93edfb6564dd6a1acd55e - github: fpco/casa diff --git a/templates/default-layout-wrapper.hamlet b/templates/default-layout-wrapper.hamlet index c7c2513..c2f816f 100644 --- a/templates/default-layout-wrapper.hamlet +++ b/templates/default-layout-wrapper.hamlet @@ -8,8 +8,8 @@ $newline never - - + + #{pageTitle pc} $if notHome diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet index e9366d7..37fb61d 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -1,17 +1,15 @@ <div class="navbar navbar-inverse navbar-static-top"> <div class="navbar-inner"> <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="/"> - <img src="/static/img/stackage.png" title="FP Complete"> + <img src="/static/img/stackage.png" title="Stackage"> <div class="nav-collapse collapse"> <ul class="nav"> - $forall route <- [AllSnapshotsR, BlogHomeR] - <li :Just route == cur:.active> - <a href=@{route}>#{route} + <li> <a href="/#about">about</a> + <li> <a href="/lts">LTS</a> + <li> <a href="/nightly">Nightly</a> + <li> <a href="/snapshots">Snapshots</a> + <li> <a href="/blog">Blog</a> $maybe msg <- mmsg <div .container> diff --git a/templates/home.hamlet b/templates/home.hamlet index 4dc1608..82da435 100644 --- a/templates/home.hamlet +++ b/templates/home.hamlet @@ -1,8 +1,9 @@ <div .container> <div .row .header> - <div .span6> + <div .span4> <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"> <div class="input-append hoogle-q"> <input class="search span3" type="search" autofocus="" name="q" value="" placeholder="E.g. map, a -> a, etc."> @@ -17,90 +18,56 @@ Exact lookup <div .row> - <div .span12> - <p> - 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. - <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). - 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. - <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 .span6> + <h4><a href="blog">Recent News</a> + $maybe post <- mrecentBlog + <p> + <a href=@{BlogPostR (postYear post) (postMonth post) (postSlug post)}>#{postTitle post}</a>, + <abbr title=#{show $ postTime post}>#{dateDiff now' (utctDay $ postTime post)}</abbr> <div .row> <div .span6> <h3> - Latest releases - - <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 + Latest LTS release per GHC version <ul> $forall (major, minor, ghc, date) <- latestLtsByGhc <li> <a href=@{SnapshotR (SNLts major minor) StackageHomeR}>LTS #{major}.#{minor} for #{ghc}# \, 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> - <h3>News - $maybe post <- mrecentBlog + <div .span6> + <h3>Recent Snapshots + $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> - <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> - <abbr title=#{show $ postTime post}>#{dateDiff now' (utctDay $ postTime post)} - $nothing - <a href="/blog">Blog - <h3>Snapshots - $forall stackages <- groups - $forall (_, _, uploaded) <- take 1 stackages - <h5> - #{uploaded} - <ul .snapshots> - $forall (ident, title, _uploaded) <- stackages - <li> - <strong> - <a href=@{SnapshotR ident StackageHomeR}> - #{title} - <p> - <a href=@{AllSnapshotsR}> - Snapshots archive + 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. + <p> + We recommend using the <a href="https://haskellstack.org">stack</a> tool, which makes using Stackage snapshots easy and convenient. + 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. + <a href="https://haskell.fpcomplete.com/get-started">Get started with Stack</a> + <p> + Stackage is a community project: Haskell users around the world work together to keep Stackage snapshots up to date with recent package versions: + Stackage itself and all the tools surrounding it are open-source. + See <a href="https://github.com/fpco/stackage/blob/master/MAINTAINERS.md#adding-a-package"> + <b>how to add packages to Stackage</b></a> + <p> + Have more questions? We have a # + <a href="https://github.com/fpco/stackage#frequently-asked-questions">FAQ section on Github</a>. + + <p> + Stackage's infrastructure, build machines, initial creation and ongoing maintenance, are proudly sponsored by <a href="https://www.fpcomplete.com">FP Complete</a>. diff --git a/templates/home.lucius b/templates/home.lucius index fb3d0cf..4f4cef1 100644 --- a/templates/home.lucius +++ b/templates/home.lucius @@ -1,10 +1,5 @@ -.navbar { - display: none; -} .logo { width: 300px; } .header { - margin-bottom: 1em; - margin-top: 2em; } diff --git a/templates/snapshots-nav.hamlet b/templates/snapshots-nav.hamlet index c887e16..09988ab 100644 --- a/templates/snapshots-nav.hamlet +++ b/templates/snapshots-nav.hamlet @@ -1,12 +1,10 @@ <div .snapshot-nav> - $if isFirstPage - at newest -- - $else + $if not isFirstPage <a href=@{AllSnapshotsR}?page=#{currentPage - 1}> - see newer -- + \< newer + <span .separator> \ Page #{currentPage} # - $if isLastPage - ++ at oldest - $else + $if not isLastPage + <span .separator> <a href=@{AllSnapshotsR}?page=#{currentPage + 1}> - ++ see older + older \> diff --git a/templates/stackage-home.hamlet b/templates/stackage-home.hamlet index 4f0aee6..74f005f 100644 --- a/templates/stackage-home.hamlet +++ b/templates/stackage-home.hamlet @@ -7,19 +7,14 @@ $newline never <span .separator> <span> <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 .stack-resolver-yaml>resolver: #{toPathPiece name} - <p>You can also use <code>stack --resolver #{toPathPiece name}</code> on the command line + <p>To use this resolver: + <p>edit your stack.yaml and set the following: + <p .stack-resolver-yaml>resolver: #{toPathPiece name} + <p>or on the command line use: + <code>stack --resolver #{toPathPiece name}</code> - <p> - <b>New to stack? - \ Check out <a href="http://docs.haskellstack.org">the stack homepage</a> + <p>For more details see <a href="http://docs.haskellstack.org">the stack homepage</a> <h3>Hoogle ^{hoogleForm}