mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-12 04:08:29 +01:00
Home: only show News if post is from the last ~6 months
This commit is contained in:
parent
ffe944ae74
commit
070cbc6bf2
@ -35,8 +35,8 @@ getHomeR = track "Handler.Snapshots.getAllSnapshotsR" $ do
|
|||||||
let latestNightly = groupUp now' nightly
|
let latestNightly = groupUp now' nightly
|
||||||
latestLtsNameWithHoogle <- getLatestLtsNameWithHoogle
|
latestLtsNameWithHoogle <- getLatestLtsNameWithHoogle
|
||||||
latestLtsByGhc <- getLatestLtsByGhc
|
latestLtsByGhc <- getLatestLtsByGhc
|
||||||
|
let sixMonthsAgo = addUTCTime (-180 * nominalDay) now'
|
||||||
mrecentBlog <- headMay <$> getPosts
|
mrecentBlog <- headMay . filter (\p -> postTime p > sixMonthsAgo) <$> getPosts
|
||||||
|
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
setTitle "Stackage Server"
|
setTitle "Stackage Server"
|
||||||
|
|||||||
@ -20,8 +20,8 @@
|
|||||||
<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>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
|
<li><a href="https://haskellstack.org">stack</a> makes using Stackage easy
|
||||||
<div .span6>
|
<div .span6>
|
||||||
<h3>News</h3>
|
$maybe post <- mrecentBlog
|
||||||
$maybe post <- mrecentBlog
|
<h3>News</h3>
|
||||||
<p>
|
<p>
|
||||||
<a href=@{BlogPostR (postYear post) (postMonth post) (postSlug post)}>#{postTitle post}</a>,
|
<a href=@{BlogPostR (postYear post) (postMonth post) (postSlug post)}>#{postTitle post}</a>,
|
||||||
<abbr title=#{show $ postTime post}>#{dateDiff now' (utctDay $ postTime post)}</abbr>
|
<abbr title=#{show $ postTime post}>#{dateDiff now' (utctDay $ postTime post)}</abbr>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user