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..5369d43 100644 --- a/src/Handler/Home.hs +++ b/src/Handler/Home.hs @@ -30,13 +30,12 @@ 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) - let groups = groupUp now' snapshots + (map entityVal -> nightly) <- + getSnapshots (Just NightlyBranch) 1 0 + let latestNightly = groupUp now' nightly + (map entityVal -> lts) <- + getSnapshots (Just LtsBranch) 1 0 + let latestLts = groupUp now' lts latestLtsNameWithHoogle <- getLatestLtsNameWithHoogle latestLtsByGhc <- getLatestLtsByGhc @@ -53,9 +52,6 @@ getHomeR = track "Handler.Snapshots.getAllSnapshotsR" $ do groupUp now' = groupBy (on (==) (\(_,_,uploaded) -> uploaded)) . map (uncrapify now') -snapshotsPerPage :: Int -snapshotsPerPage = 8 - getAuthorsR :: Handler Html getAuthorsR = contentHelper "Library Authors" wcAuthors 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/src/Stackage/Database/Query.hs b/src/Stackage/Database/Query.hs index d993104..17a7495 100644 --- a/src/Stackage/Database/Query.hs +++ b/src/Stackage/Database/Query.hs @@ -77,7 +77,6 @@ module Stackage.Database.Query ) where import qualified Data.Aeson as A -import Data.Bifunctor (bimap) import qualified Data.List as L import Database.Esqueleto import Database.Esqueleto.Internal.Language (FromPreprocess) diff --git a/src/Types.hs b/src/Types.hs index f1d68af..4745ddb 100644 --- a/src/Types.hs +++ b/src/Types.hs @@ -50,7 +50,6 @@ module Types import ClassyPrelude.Yesod (ToBuilder(..)) import Data.Aeson -import Data.Bifunctor (bimap) import Data.Char (ord) import Data.Hashable (hashUsing, hashWithSalt) import qualified Data.Text as T diff --git a/stack.yaml b/stack.yaml index 57e34a1..b23373d 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 -- hoogle-5.0.17.14@sha256:a35eab4f833cd131f1abc79360e3bdbc5aecd7526b9a530ac606580e18691e2b,3173 -- hpack-0.33.0@sha256:ca82f630abe0fba199aa05dcc9942ee8bf137e1425049a7a9ac8458c82d9dcc9,4406 +- hackage-security-0.6.0.1 +- hoogle-5.0.18 - 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..c9faf80 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -6,12 +6,15 @@ <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="https://github.com/fpco/stackage#frequently-asked-questions">FAQ</a> + <li> <a href="/blog">Blog</a> $maybe msg <- mmsg <div .container> diff --git a/templates/default-layout.lucius b/templates/default-layout.lucius index af88ecb..be5abbe 100644 --- a/templates/default-layout.lucius +++ b/templates/default-layout.lucius @@ -10,7 +10,6 @@ html { body { background: #f0f0f0; font-family: 'Lato', sans-serif; - text-shadow: 1px 1px 1px #ffffff; margin-bottom: 4em; padding-bottom: 2em; } @@ -43,7 +42,6 @@ code,pre { .navbar-inner { border-color: #06537d !important; } .footer { - text-shadow: none; background: #0981c3; border-top: 1px solid #ddd; color: #fff; diff --git a/templates/home.hamlet b/templates/home.hamlet index 4dc1608..94c2150 100644 --- a/templates/home.hamlet +++ b/templates/home.hamlet @@ -1,106 +1,70 @@ <div .container> - <div .row .header> - <div .span6> + <div> + <div .span5> <img src=@{StaticR img_logo_png} .logo> - <div .span6> + <div .span3> + <p> <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."> + <input class="search span3" type="search" autofocus="" name="q" value="" placeholder="Hoogle search LTS"> <button class="btn" type="submit"> Search - <span class="brws-pkgs"> - or - <a href="/lts"> - browse packages <label class="checkbox exact-lookup" for="exact" title="Only find identifiers matching your search term precisely"> <input type="checkbox" name="exact" id="exact"> 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 .row> + <div> + <div .span6> + <h3>Stable Haskell package sets + <ul> + <li>A distribution of compatible Haskell packages from <a href="https://hackage.haskell.org">Hackage</a> that build together + <li>Stackage is a community project: <a href="https://github.com/fpco/stackage/blob/master/MAINTAINERS.md#adding-a-package"><b>how to add packages to Stackage</b></a> + <li><a href="https://haskellstack.org">stack</a> makes using Stackage easy + <div .span6> + <h3>News</h3> + <ul .snapshots> + $forall stackages <- latestNightly + $forall (ident, title, uploaded) <- stackages + <li> + <strong> + <a href=@{SnapshotR ident StackageHomeR}>#{title}</a>, #{uploaded} + $forall stackages <- latestLts + $forall (ident, title, uploaded) <- stackages + <li> + <strong> + <a href=@{SnapshotR ident StackageHomeR}>#{title}</a>, #{uploaded} + $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 .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 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..2439b2b 100644 --- a/templates/home.lucius +++ b/templates/home.lucius @@ -1,10 +1,3 @@ -.navbar { - display: none; -} .logo { width: 300px; } -.header { - margin-bottom: 1em; - margin-top: 2em; -} diff --git a/templates/package.lucius b/templates/package.lucius index 167973a..ad7eb9a 100644 --- a/templates/package.lucius +++ b/templates/package.lucius @@ -239,7 +239,6 @@ h2.changes-title { } .tag-count { border: 0.1em solid #d8d8d8; - text-shadow: none; padding: 0 0.25em; border-radius: 0.25em; color: #999; @@ -290,4 +289,3 @@ div.plain-text { padding: 0.5em; background: #eef; } - 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} diff --git a/templates/stackage-home.lucius b/templates/stackage-home.lucius index aba44e7..c32c9a9 100644 --- a/templates/stackage-home.lucius +++ b/templates/stackage-home.lucius @@ -55,7 +55,6 @@ hr { display: inline-block; padding: 0 0.5em; margin-right: 0.5em; - text-shadow: none; } } }