Merge pull request #296 from juhp/website-tweaks

homepage rework and other improvements
This commit is contained in:
Michael Snoyman 2020-11-01 17:12:44 +02:00 committed by GitHub
commit 44dd6a5c5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 81 additions and 154 deletions

View File

@ -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

View File

@ -30,13 +30,12 @@ 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" (map entityVal -> nightly) <-
let currentPage :: Int getSnapshots (Just NightlyBranch) 1 0
currentPage = fromMaybe 1 (currentPageMay >>= readMay) let latestNightly = groupUp now' nightly
(map entityVal -> snapshots) <- (map entityVal -> lts) <-
getSnapshots Nothing snapshotsPerPage getSnapshots (Just LtsBranch) 1 0
((fromIntegral currentPage - 1) * snapshotsPerPage) let latestLts = groupUp now' lts
let groups = groupUp now' snapshots
latestLtsNameWithHoogle <- getLatestLtsNameWithHoogle latestLtsNameWithHoogle <- getLatestLtsNameWithHoogle
latestLtsByGhc <- getLatestLtsByGhc latestLtsByGhc <- getLatestLtsByGhc
@ -53,9 +52,6 @@ getHomeR = track "Handler.Snapshots.getAllSnapshotsR" $ do
groupUp now' = groupBy (on (==) (\(_,_,uploaded) -> uploaded)) groupUp now' = groupBy (on (==) (\(_,_,uploaded) -> uploaded))
. map (uncrapify now') . map (uncrapify now')
snapshotsPerPage :: Int
snapshotsPerPage = 8
getAuthorsR :: Handler Html getAuthorsR :: Handler Html
getAuthorsR = contentHelper "Library Authors" wcAuthors getAuthorsR = contentHelper "Library Authors" wcAuthors

View File

@ -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

View File

@ -77,7 +77,6 @@ module Stackage.Database.Query
) where ) where
import qualified Data.Aeson as A import qualified Data.Aeson as A
import Data.Bifunctor (bimap)
import qualified Data.List as L import qualified Data.List as L
import Database.Esqueleto import Database.Esqueleto
import Database.Esqueleto.Internal.Language (FromPreprocess) import Database.Esqueleto.Internal.Language (FromPreprocess)

View File

@ -50,7 +50,6 @@ module Types
import ClassyPrelude.Yesod (ToBuilder(..)) import ClassyPrelude.Yesod (ToBuilder(..))
import Data.Aeson import Data.Aeson
import Data.Bifunctor (bimap)
import Data.Char (ord) import Data.Char (ord)
import Data.Hashable (hashUsing, hashWithSalt) import Data.Hashable (hashUsing, hashWithSalt)
import qualified Data.Text as T import qualified Data.Text as T

View File

@ -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.18
- 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

View File

@ -8,8 +8,8 @@ $newline never
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link href="//fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet" type="text/css"> <link href="//fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet" type="text/css">
<link rel="search" type="application/opensearchdescription+xml" title="Stackage.org hoogle" href="/static/opensearchhoogle.xml"> <link rel="search" type="application/opensearchdescription+xml" title="Stackage.org hoogle" href="/static/opensearchhoogle.xml">
<link rel="search" type="application/opensearchdescription+xml" title="Stackage.org package page" href="/static/opensearchpackage.xml"> <link rel="search" type="application/opensearchdescription+xml" title="Stackage.org package page" href="/static/opensearchpackage.xml">
<title> <title>
#{pageTitle pc} #{pageTitle pc}
$if notHome $if notHome

View File

@ -6,12 +6,15 @@
<span class="icon-bar"> <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="https://github.com/fpco/stackage#frequently-asked-questions">FAQ</a>
<li> <a href="/blog">Blog</a>
$maybe msg <- mmsg $maybe msg <- mmsg
<div .container> <div .container>

View File

@ -10,7 +10,6 @@ html {
body { body {
background: #f0f0f0; background: #f0f0f0;
font-family: 'Lato', sans-serif; font-family: 'Lato', sans-serif;
text-shadow: 1px 1px 1px #ffffff;
margin-bottom: 4em; margin-bottom: 4em;
padding-bottom: 2em; padding-bottom: 2em;
} }
@ -43,7 +42,6 @@ code,pre {
.navbar-inner { border-color: #06537d !important; } .navbar-inner { border-color: #06537d !important; }
.footer { .footer {
text-shadow: none;
background: #0981c3; background: #0981c3;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
color: #fff; color: #fff;

View File

@ -1,106 +1,70 @@
<div .container> <div .container>
<div .row .header> <div>
<div .span6> <div .span5>
<img src=@{StaticR img_logo_png} .logo> <img src=@{StaticR img_logo_png} .logo>
<div .span6> <div .span3>
<p>
<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="Hoogle search LTS">
<button class="btn" type="submit"> <button class="btn" type="submit">
Search 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"> <label class="checkbox exact-lookup" for="exact" title="Only find identifiers matching your search term precisely">
<input type="checkbox" name="exact" id="exact"> <input type="checkbox" name="exact" id="exact">
Exact lookup Exact lookup
<div>
<div .row> <div .span6>
<div .span12> <h3>Stable Haskell package sets
<p> <ul>
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. <li>A distribution of compatible Haskell packages from <a href="https://hackage.haskell.org">Hackage</a> that build together
<p> <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>
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). <li><a href="https://haskellstack.org">stack</a> makes using Stackage easy
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. <div .span6>
<p> <h3>News</h3>
<a href="https://haskellstack.org">Stack</a> is a tool made specifically to make using Stackage snapshots easy and convenient. <ul .snapshots>
We recommend you to use it. $forall stackages <- latestNightly
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. $forall (ident, title, uploaded) <- stackages
<p> <li>
Stackage is a community project: Haskell users around the world work together to create the stable snapshots. <strong>
<br /> <a href=@{SnapshotR ident StackageHomeR}>#{title}</a>, #{uploaded}
Stackage itself and all tools surrounding it are open-source. $forall stackages <- latestLts
<p> $forall (ident, title, uploaded) <- stackages
Stackage's infrastructure, build machines, initial creation and ongoing maintenance, are proudly sponsored by <a href="https://www.fpcomplete.com">FP Complete</a>. <li>
<strong>
<div .row> <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> <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 id="about">
$maybe post <- mrecentBlog 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

View File

@ -1,10 +1,3 @@
.navbar {
display: none;
}
.logo { .logo {
width: 300px; width: 300px;
} }
.header {
margin-bottom: 1em;
margin-top: 2em;
}

View File

@ -239,7 +239,6 @@ h2.changes-title {
} }
.tag-count { .tag-count {
border: 0.1em solid #d8d8d8; border: 0.1em solid #d8d8d8;
text-shadow: none;
padding: 0 0.25em; padding: 0 0.25em;
border-radius: 0.25em; border-radius: 0.25em;
color: #999; color: #999;
@ -290,4 +289,3 @@ div.plain-text {
padding: 0.5em; padding: 0.5em;
background: #eef; background: #eef;
} }

View File

@ -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 \>

View File

@ -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}

View File

@ -55,7 +55,6 @@ hr {
display: inline-block; display: inline-block;
padding: 0 0.5em; padding: 0 0.5em;
margin-right: 0.5em; margin-right: 0.5em;
text-shadow: none;
} }
} }
} }