Nicer layout for h-entry, with cute icons
This commit is contained in:
parent
03cd1487fe
commit
0e80d93994
3 changed files with 24 additions and 10 deletions
|
@ -8,7 +8,10 @@ import Import
|
|||
import Data.Time.Format ( defaultTimeLocale, formatTime, iso8601DateFormat )
|
||||
import Data.Time.Format.Human ( humanReadableTime )
|
||||
|
||||
data FormattedTime = FormattedTime { timeUnfriendly :: String, timeFriendly :: String }
|
||||
data FormattedTime = FormattedTime
|
||||
{ timeUnfriendly :: String
|
||||
, timeFriendly :: String
|
||||
} deriving Eq
|
||||
|
||||
toFormattedTime :: MonadIO m => UTCTime -> m FormattedTime
|
||||
toFormattedTime time = FormattedTime (unfriendly time) <$> friendly time
|
||||
|
|
7
templates/mf2/h-entry.cassius
Normal file
7
templates/mf2/h-entry.cassius
Normal file
|
@ -0,0 +1,7 @@
|
|||
article.h-entry
|
||||
> .card-footer
|
||||
display: flex
|
||||
flex-wrap: wrap
|
||||
justify-content: space-evenly
|
||||
> *
|
||||
margin-right: 1em
|
|
@ -1,15 +1,19 @@
|
|||
<article .h-entry .card.bg-dark>
|
||||
<div .card-body>
|
||||
<h4 .p-name .card-title>#{entryName entry}
|
||||
$maybe author <- maybeAuthor
|
||||
<p .card-subtitle>
|
||||
published by
|
||||
<a .p-author.h-card href=@{HomeR}>#{userFullName author}
|
||||
<div .e-content>
|
||||
#{entryContent entry}
|
||||
<a .u-url .card-link href="@{entryR (Entity entryId entry)}">permalink
|
||||
<div .card-footer>
|
||||
$maybe author <- maybeAuthor
|
||||
<a .p-author.h-card href=@{HomeR}>
|
||||
<i .fa.fa-user>
|
||||
#{userFullName author}
|
||||
<a .u-url href="@{entryR (Entity entryId entry)}">
|
||||
<i .fa.fa-link>
|
||||
permalink
|
||||
<time .dt-published datetime=#{timeUnfriendly published}>
|
||||
<i .fa.fa-calendar>
|
||||
#{timeFriendly published}
|
||||
<time .dt-updated datetime=#{timeUnfriendly updated}>
|
||||
<time .dt-updated datetime=#{timeUnfriendly updated} :published == updated:hidden>
|
||||
<i .fa.fa-pencil>
|
||||
#{timeFriendly updated}
|
||||
|
|
Loading…
Reference in a new issue