提交 79b73bf6 编写于 作者: EvanOne(文一)'s avatar EvanOne(文一)

feat: Add support for front-matter: link

上级 16f2b3b5
......@@ -56,7 +56,7 @@ post:
read_more: Read more
fire: Heat
sticky: Sticky top
untitled: Untitled
untitled: ( Untitled )
end: End of text, thank you for reading
copyright:
author: Author
......
......@@ -56,7 +56,7 @@ post:
read_more: 阅读全文
fire: 热度
sticky: 置顶文章
untitled: 文章未命名
untitled: ( 文章未命名 )
end: 本文结束,感谢您的阅读
copyright:
author: 本文作者
......
mixin postHeader(post)
div.post-header
if (is_post())
if (post.title)
h1.post-title= post.title
else
h1.post-title= _p("post.untitled")
if is_post()
h1.post-title= post.title || _p("post.untitled")
else
a(href=url_for(post.canonical_path)).post-title-link
if (post.title)
h1.post-title= post.title
else
h1.post-title= _p("post.untitled")
if post.link
a(href=url_for(post.link) target="_blank").post-title-link
h1.post-title= post.title || post.link
else
a(href=url_for(post.canonical_path)).post-title-link
h1.post-title= post.title || _p("post.untitled")
div.post-meta
if theme.post_meta.created.enable
......@@ -19,10 +17,7 @@ mixin postHeader(post)
if !theme.post_meta.icon_only
span= _p("post.posted") + " "
if post.date
span= full_date(post.date, "YYYY-MM-DD")
else
span none
span= post.date ? full_date(post.date, "YYYY-MM-DD") : 'none'
if theme.post_meta.updated.enable
span.post-meta-update
......@@ -30,10 +25,7 @@ mixin postHeader(post)
if !theme.post_meta.icon_only
span= _p("post.updated") + " "
if post.updated
span= full_date(post.updated, "YYYY-MM-DD")
else
span none
span= post.updated ? full_date(post.updated, "YYYY-MM-DD") : 'none'
if theme.post_meta.word_count.enable
span.post-meta-word-count
......
......@@ -13,7 +13,10 @@ mixin articleSort(posts)
if post.date
time.article-sort-item__time= full_date(post.date, "MM-DD")
h2.article-sort-item__title
a(href=url_for(post.path))= post.title || "No Title"
if post.link
a(href=url_for(post.link) target="_blank")= post.title || post.link
else
a(href=url_for(post.path))= post.title || _p('post.untitled')
if post.top
include ../_components/sticky-top.pug
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册