Yablog-0.0.1.1: templates/homepage.hamlet
<h2>Recent Articles
<ul .pager>
$if (>) offset 0
<li .next>
<a href="@{RootR}?of=#{max 0 $ subtract offset 5}">
Newer Articles →
$if hasMore
<li .previous>
<a href="@{RootR}?of=#{(+) offset 5}">
← Older Articles
$forall (no, ents) <- articles
$with (art, cs, ts) <- ents
<div .well>
^{articleView (Just $ (++) "art" $ (++) (show no) "-") art}
<div .navi-links>
<a href=@{articleLink art}>
Permalink
\ | #
<a href="@{articleLink art}#comments">
$if (==) cs 0
_{MsgNoComments}
$else
_{MsgComments} (#{cs})
\ | #
<a href="@{articleLink art}#trackbacks">
$if (==) ts 0
_{MsgNoTrackbacks}
$else
_{MsgTrackbacks} (#{ts})
<ul class="pager">
$if (>) offset 0
<li .next>
<a href="@{RootR}?of=#{max 0 (subtract offset 5)}">
Newer Articles →
$if hasMore
<li .previous>
<a href="@{RootR}?of=#{(+) offset 5}">
← Older Articles