diff --git a/_config.yml b/_config.yml
index 22bdc07..98a7d7b 100755
--- a/_config.yml
+++ b/_config.yml
@@ -40,7 +40,7 @@ sidebar:
others: search, recent, timeline # for 404 and ...
#### 手动创建的页面 ####
# 文章内页
- post: search_blog, toc, ghrepo, ghissues # for pages using 'layout:post'
+ post: search_blog, toc, related, ghrepo, ghissues # for pages using 'layout:post'
# 文档内页
wiki: search, toc, ghissues, related # for pages using 'layout:wiki'
# 其它 layout:page 的页面
diff --git a/languages/en.yml b/languages/en.yml
index 329fdfa..4421f00 100755
--- a/languages/en.yml
+++ b/languages/en.yml
@@ -24,6 +24,7 @@ meta:
comment_title: Join the discussion
back_to_top: Back to top
more: 'More %s'
+ posts_in_category: 'Category: %s'
created_author: '%s posted on'
created: 'Posted on'
updated: 'Updated on'
diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml
index f839359..dc0d8a1 100755
--- a/languages/zh-CN.yml
+++ b/languages/zh-CN.yml
@@ -24,6 +24,7 @@ meta:
comment_title: 快来参与讨论吧
back_to_top: 回到顶部
more: '更多「%s」'
+ posts_in_category: '专栏:%s'
created_author: 本文由 %s 发布于
created: 发布于
updated: 更新于
diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml
index 083d140..9128091 100755
--- a/languages/zh-TW.yml
+++ b/languages/zh-TW.yml
@@ -24,6 +24,7 @@ meta:
comment_title: 參與討論
back_to_top: 回到頁首
more: '更多「%s」'
+ posts_in_category: '專欄:%s'
created_author: 本文由 %s 發布於
created: 發布於
updated: 更新於
diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs
index 33d5f1d..a822a45 100755
--- a/layout/_partial/head.ejs
+++ b/layout/_partial/head.ejs
@@ -26,7 +26,7 @@ function generate_description() {
if (theme.open_graph && theme.open_graph.enable) {
return '';
}
- if (page.layout == 'wiki' && page.wiki) {
+ if (page.wiki) {
let proj = theme.wiki.tree[page.wiki];
if (proj && proj.description) {
return '';
diff --git a/layout/_partial/main/article/article_footer.ejs b/layout/_partial/main/article/article_footer.ejs
index 0524213..0a91d90 100644
--- a/layout/_partial/main/article/article_footer.ejs
+++ b/layout/_partial/main/article/article_footer.ejs
@@ -38,11 +38,7 @@ function layoutDiv() {
}
var license = ''
- if (page.layout == 'post') {
- if (theme.article.license && (page.license != false)) {
- license = page.license || theme.article.license
- }
- } else if (page.layout == 'wiki' && page.wiki) {
+ if (page.wiki) {
let proj = theme.wiki.tree[page.wiki]
if (page.license != null) {
license = page.license || theme.article.license
@@ -53,6 +49,10 @@ function layoutDiv() {
license = proj.license
}
}
+ } else if (page.layout == 'post') {
+ if (theme.article.license && (page.license != false)) {
+ license = page.license || theme.article.license
+ }
}
if (license.length > 0) {
var author = null
@@ -75,15 +75,15 @@ function layoutDiv() {
}
var showSharePlugin = false
- if (page.layout == 'post') {
- showSharePlugin = page.share != false
- } else if (page.layout == 'wiki' && page.wiki) {
+ if (page.wiki) {
let proj = theme.wiki.tree[page.wiki]
if (page.share != null) {
showSharePlugin = page.share == true
} else if (proj != null) {
showSharePlugin = proj.share == true
}
+ } else if (page.layout == 'post') {
+ showSharePlugin = page.share != false
}
if (theme.article.share && showSharePlugin) {
function socialButtons() {
@@ -101,8 +101,8 @@ function layoutDiv() {
el += '&title=' + (page.seo_title || (page.title + ' - ' + config.title));
if (page.layout == 'post' && page.cover) {
el += '&pics=' + page.cover;
- } else if (page.layout == 'wiki' && page.logo && page.logo.src) {
- el += '&pics=' + page.logo.src;
+ } else if (page.layout == 'wiki' && page.icon) {
+ el += '&pics=' + page.icon;
}
el += '&summary=' + truncate(page.description || strip_html(page.excerpt || page.content), {length: 120});
el += '"';
diff --git a/layout/_partial/widgets/related.ejs b/layout/_partial/widgets/related.ejs
index deafec0..a902ed3 100644
--- a/layout/_partial/widgets/related.ejs
+++ b/layout/_partial/widgets/related.ejs
@@ -1,34 +1,59 @@
<%
-function layoutDiv() {
- if (page.layout !== "wiki") {
- return '';
+function relatedPosts() {
+ const { categories } = page;
+ if (categories.length == 0) {
+ return ''
}
- let thisItemObject = theme.wiki.tree[page.wiki];
+ const relatedItem = categories.data[0]
+ var el = ''
+ el += `