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 ( defaultTimeLocale, formatTime, iso8601DateFormat )
|
||||||
import Data.Time.Format.Human ( humanReadableTime )
|
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 :: MonadIO m => UTCTime -> m FormattedTime
|
||||||
toFormattedTime time = FormattedTime (unfriendly time) <$> friendly time
|
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>
|
<article .h-entry .card.bg-dark>
|
||||||
<div .card-body>
|
<div .card-body>
|
||||||
<h4 .p-name .card-title>#{entryName entry}
|
<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>
|
<div .e-content>
|
||||||
#{entryContent entry}
|
#{entryContent entry}
|
||||||
<a .u-url .card-link href="@{entryR (Entity entryId entry)}">permalink
|
|
||||||
<div .card-footer>
|
<div .card-footer>
|
||||||
<time .dt-published datetime=#{timeUnfriendly published}>
|
$maybe author <- maybeAuthor
|
||||||
#{timeFriendly published}
|
<a .p-author.h-card href=@{HomeR}>
|
||||||
<time .dt-updated datetime=#{timeUnfriendly updated}>
|
<i .fa.fa-user>
|
||||||
#{timeFriendly updated}
|
#{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} :published == updated:hidden>
|
||||||
|
<i .fa.fa-pencil>
|
||||||
|
#{timeFriendly updated}
|
||||||
|
|
Loading…
Reference in a new issue