-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathArchivedPosts.hs
More file actions
25 lines (20 loc) · 888 Bytes
/
ArchivedPosts.hs
File metadata and controls
25 lines (20 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module ArchivedPosts where
import Data.Monoid
import qualified Data.Text.Lazy as T
import Types
archivedPosts :: [Publish]
-> T.Text
archivedPosts p = outputArchives . mconcat . map formatArchives $ p
where
outputArchives x = mconcat [ T.pack "<div class=\"archives\"><div class=\"archivesHeader\">Archived Posts:</div><div class=\"archivesContent\"><ul>"
, x
, T.pack "</ul></div></div>"
]
formatArchives x = mconcat [ T.pack "<li>"
, T.pack "<a href=\""
, T.pack $ _publishedURL x
, T.pack "\">"
, title x
, T.pack "</a>"
, T.pack "</li>" ]
title x = _title . _post $ x