forked from ruHaskell/ruhaskell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinks.hs
33 lines (27 loc) · 1.29 KB
/
Links.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{-
Модуль, отвечающий за формирование страницы со ссылками на сторонние ресурсы.
https://github.com/denisshevchenko/ruhaskell
Все права принадлежат русскоязычному сообществу Haskell-разработчиков, 2015 г.
-}
{-# LANGUAGE OverloadedStrings #-}
module Links (
createPageWithExternalLinks
) where
import Data.Monoid (mconcat)
import Misc (TagsReader)
import Control.Monad.Reader
import Hakyll
-- Формируем страницу с внешними ссылками на всякие полезные вещи.
createPageWithExternalLinks :: TagsReader
createPageWithExternalLinks = do
lift $ create ["links.html"] $ do
route idRoute
compile $ do
let linksContext = mconcat [ constField "linksTitle" "Ссылки"
, constField "title" "Ссылки"
, defaultContext
]
makeItem "" >>= loadAndApplyTemplate "templates/links.html" linksContext
>>= loadAndApplyTemplate "templates/default.html" linksContext
>>= relativizeUrls
return ()