mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-11 19:58:28 +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
|
||||
latestLtsNameWithHoogle <- getLatestLtsNameWithHoogle
|
||||
latestLtsByGhc <- getLatestLtsByGhc
|
||||
|
||||
mrecentBlog <- headMay <$> getPosts
|
||||
let sixMonthsAgo = addUTCTime (-180 * nominalDay) now'
|
||||
mrecentBlog <- headMay . filter (\p -> postTime p > sixMonthsAgo) <$> getPosts
|
||||
|
||||
defaultLayout $ do
|
||||
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><a href="https://haskellstack.org">stack</a> makes using Stackage easy
|
||||
<div .span6>
|
||||
<h3>News</h3>
|
||||
$maybe post <- mrecentBlog
|
||||
$maybe post <- mrecentBlog
|
||||
<h3>News</h3>
|
||||
<p>
|
||||
<a href=@{BlogPostR (postYear post) (postMonth post) (postSlug post)}>#{postTitle post}</a>,
|
||||
<abbr title=#{show $ postTime post}>#{dateDiff now' (utctDay $ postTime post)}</abbr>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user