* version 3.0
* fixed read-more links
This commit is contained in:
parent
df9a17b695
commit
579c11cd2a
2 changed files with 13 additions and 7 deletions
14
src/Blog.hs
14
src/Blog.hs
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
module Blog where
|
module Blog where
|
||||||
|
|
||||||
|
import Control.Monad (when, unless)
|
||||||
import Data.Data (Data, Typeable)
|
import Data.Data (Data, Typeable)
|
||||||
import Data.List (intersperse)
|
import Data.List (intersperse)
|
||||||
import Data.Monoid (mempty)
|
import Data.Monoid (mempty)
|
||||||
|
@ -71,10 +72,15 @@ renderEntries showAll entries topText footerLinks =
|
||||||
where
|
where
|
||||||
showEntry :: Entry -> Html
|
showEntry :: Entry -> Html
|
||||||
showEntry e = H.li $ do
|
showEntry e = H.li $ do
|
||||||
entryLink e
|
entryLink e $ T.pack $ show(length $ comments e)
|
||||||
preEscapedText $ T.concat [" ", btext e, "<br> </br>"]
|
preEscapedText $ T.append " " $ btext e
|
||||||
entryLink e = H.a ! A.href (toValue $ concat $ intersperse' "/" $ linkElems e) $
|
when ( mtext e /= T.empty ) $
|
||||||
toHtml ("[" ++ show(length $ comments e) ++ "]")
|
H.p $ entryLink e $ readMore $ lang e
|
||||||
|
unless ( mtext e /= T.empty ) $
|
||||||
|
preEscapedText "<br> </br>"
|
||||||
|
entryLink :: Entry -> Text -> Html
|
||||||
|
entryLink e s = H.a ! A.href (toValue $ concat $ intersperse' "/" $ linkElems e) $
|
||||||
|
toHtml (T.concat ["[", s, "]"])
|
||||||
linkElems e = [show(lang e), show $ entryId e]
|
linkElems e = [show(lang e), show $ entryId e]
|
||||||
getFooterLinks (Just h) = h
|
getFooterLinks (Just h) = h
|
||||||
getFooterLinks Nothing = mempty
|
getFooterLinks Nothing = mempty
|
||||||
|
|
|
@ -13,7 +13,7 @@ import BlogDB (BlogLang (..))
|
||||||
|
|
||||||
data BlogError = NotFound | DBError
|
data BlogError = NotFound | DBError
|
||||||
|
|
||||||
version = "2.2b"
|
version = "3.0"
|
||||||
|
|
||||||
allLang = [EN, DE]
|
allLang = [EN, DE]
|
||||||
|
|
||||||
|
@ -73,8 +73,8 @@ nextText DE = "Später"
|
||||||
nextText EN = "Later"
|
nextText EN = "Later"
|
||||||
|
|
||||||
readMore :: BlogLang -> Text
|
readMore :: BlogLang -> Text
|
||||||
readMore DE = "[Weiterlesen]"
|
readMore DE = "Weiterlesen"
|
||||||
readMore EN = "[Read more]"
|
readMore EN = "Read more"
|
||||||
|
|
||||||
-- contact information
|
-- contact information
|
||||||
contactText :: BlogLang -> Text
|
contactText :: BlogLang -> Text
|
||||||
|
|
Loading…
Reference in a new issue