Skip to content

Commit

Permalink
✨ Feature: post_meta.date_type add both option
Browse files Browse the repository at this point in the history
  • Loading branch information
Evolution404 authored and Molunerfinn committed Jan 29, 2020
1 parent 30bfb34 commit 01dad37
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
4 changes: 3 additions & 1 deletion languages/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ no_title: No title
read_more: Read more

post:
created: created
updated: updated
wordcount: Word count
min2read: 'Reading time: %s min'
copyright:
Expand All @@ -46,4 +48,4 @@ local_search:
label: Local search
input_placeholder: Search for Posts
hits_empty: "We didn't find any results for the search: ${query}"
powered_by: Powered by
powered_by: Powered by
4 changes: 3 additions & 1 deletion languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ no_title: No title
read_more: Read more

post:
created: created
updated: updated
wordcount: Word count
min2read: 'Reading time: %s min'
copyright:
Expand All @@ -46,4 +48,4 @@ local_search:
label: Local search
input_placeholder: Search for Posts
hits_empty: "We didn't find any results for the search: ${query}"
powered_by: Powered by
powered_by: Powered by
4 changes: 3 additions & 1 deletion languages/zh-Hans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ no_title: 无题
read_more: 阅读更多

post:
created: 发表于
updated: 更新于
wordcount: 字数总计
min2read: '阅读时长: %s 分钟'
copyright:
Expand All @@ -46,4 +48,4 @@ local_search:
input_placeholder: 搜索文章
hits_empty: "找不到您查询的内容:${query}"
powered: "提供支持"
by:
by:
14 changes: 11 additions & 3 deletions layout/post.pug
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@ block top_img
#post-title= page.title || _p('no_title')
#post-meta
if (theme.post_meta.date_type)
- var date_type = theme.post_meta.date_type === 'updated' ? 'updated' : 'date'
time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(page[date_type], config.date_format)]
if (theme.post_meta.date_type === 'both')
time.post-meta__date
i.fa.fa-calendar(aria-hidden="true")
=' '+_p('post.created')+' '+date(page.date, config.date_format)
span.post-meta__separator |
i.fa.fa-calendar-check-o(aria-hidden="true")
=' '+_p('post.updated')+' '+date(page.updated, config.date_format)
else
- var date_type = theme.post_meta.date_type === 'updated' ? 'updated' : 'date'
time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(page[date_type], config.date_format)]
if (theme.post_meta.categories && page.categories.data.length > 0)
if (theme.post_meta.date_type)
span.post-meta__separator |
Expand Down Expand Up @@ -96,4 +104,4 @@ block content
if (theme.adv && theme.adv.enable)
.post-adv!= theme.adv.info
if page.comments !== false
include includes/comments/index.pug
include includes/comments/index.pug

0 comments on commit 01dad37

Please sign in to comment.