mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-11 19:58:28 +01:00
Merge pull request #307 from juhp/master
hide News if no recent blog posts
This commit is contained in:
commit
37eb5f3da6
10
README.md
10
README.md
@ -1,5 +1,4 @@
|
||||
stackage-server
|
||||
===============
|
||||
# stackage-server
|
||||
|
||||

|
||||
|
||||
@ -16,6 +15,13 @@ Build locally by passing the `dev` flag to it:
|
||||
$ stack build . --flag stackage-server:dev
|
||||
```
|
||||
|
||||
## Simple testing with sqlite:
|
||||
To test the UI without real data, just run:
|
||||
```
|
||||
$ yesod devel
|
||||
```
|
||||
|
||||
## Testing with postgresql
|
||||
Now, initially you need to run the cron job to create and populate the database:
|
||||
|
||||
``` shellsession
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
resolver: lts-16.20
|
||||
resolver: lts-16.31
|
||||
extra-deps:
|
||||
- barrier-0.1.1@sha256:2021f84c3aba67bb635d72825d3bc0371942444dc014bc307b875071e29eea98,3931
|
||||
- hackage-security-0.6.0.1
|
||||
|
||||
@ -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