chore(blog): Minor changes to integrate DNS based backend

This commit is contained in:
Vincent Ambo 2019-08-22 18:58:11 +01:00
parent c5ef3e01b2
commit bd47122afb
5 changed files with 18 additions and 21 deletions

View file

@ -5,7 +5,7 @@ import qualified Data.Text as T
import Control.Monad (liftM)
import Data.Maybe (fromMaybe)
import Data.Time (UTCTime, getCurrentTime)
import Data.Time (UTCTime(..), getCurrentTime, secondsToDiffTime)
import Network.URI
import Text.RSS
@ -13,11 +13,11 @@ import BlogStore
import Locales
createChannel :: BlogLang -> UTCTime -> [ChannelElem]
createChannel l now = [ Language $ show l
, Copyright "Vincent Ambo"
, WebMaster "tazjin@gmail.com"
, ChannelPubDate now
]
createChannel l now = [ Language $ show l
, Copyright "Vincent Ambo"
, WebMaster "tazjin@gmail.com"
, ChannelPubDate now
]
createRSS :: BlogLang -> UTCTime -> [Item] -> RSS
createRSS l t = RSS (rssTitle l) (rssLink l) (rssDesc l) (createChannel l t)
@ -26,7 +26,7 @@ createItem :: Entry -> Item
createItem Entry{..} = [ Title $ T.unpack title
, Link $ makeLink lang entryId
, Description $ T.unpack btext
, PubDate edate]
, PubDate $ UTCTime edate $ secondsToDiffTime 0 ]
makeLink :: BlogLang -> EntryId -> URI
makeLink l i = let url = "http://tazj.in/" ++ show l ++ "/" ++ show i