Files
zhdiary/themes/blog/layouts/includes/mixins.pug
T
2019-08-12 01:22:06 +07:00

22 lines
735 B
Plaintext

mixin post(post)
.card.p-2.post(class=`${post.teaser ? 'teaser' : 'full'}`)
.post-meta.mb-3
.float-right
+date(post.date)
.post-meta--author
a(href=`${post.author.link}`): img.mr-3(src=`${post.author.avatar}`)
a(href=`${post.author.link}`)= post.author.login
header
if post.teaser
h2: a(href=`${cogear.config.baseUrl || "/"}${post.uri}`)= post.title
else
h1= post.title
.post-content!= post.teaser ? post.teaser : post.content
if !post.teaser
a(href="javascript: history.back()") ← Back
mixin date(date)
- let months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
- let d = new Date(date)
- month = months[d.getMonth()]
time= `${month} ${d.getDate()}`