Skip to content

Commit

Permalink
feat: Add support for 'reward' of front-matter in pages other than posts
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyib committed Nov 13, 2019
1 parent 583cacb commit 63c1473
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion layout/_partials/sidebar/sidebar.pug
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-
var fa_prefix = theme.fa_prefix || 'fa';
var isShowToc = is_post() && (!(page.toc === false) && (theme.toc && theme.toc.enable));
var isShowToc = is_post() && ((page.toc !== false) && (theme.toc && theme.toc.enable));
if isShowToc
div.sidebar-nav
Expand Down
3 changes: 3 additions & 0 deletions layout/page.pug
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ block content
if page.photos && page.photos.length
+gallery(page)
!= page.content

if (page.reward === true) && (theme.reward && theme.reward.enable)
include ./_partials/widgets/reward.pug
4 changes: 2 additions & 2 deletions layout/post.pug
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ block content
span= __("post.end")
span= " ------"

if !(page.copyright === false) && (theme.creative_commons.enable && theme.creative_commons.post)
if (page.copyright !== false) && (theme.creative_commons.enable && theme.creative_commons.post)
include ./_partials/widgets/copyright.pug

if theme.post_widget.tags
Expand All @@ -32,7 +32,7 @@ block content
i.post-tags-item__i(class=`${fa_prefix} fa-tags`)
a.post-tags-item__a(href=tag.permalink)= tag.name

if !(page.reward === false) && (theme.reward && theme.reward.enable)
if (page.reward !== false) && (theme.reward && theme.reward.enable)
include ./_partials/widgets/reward.pug

include ./_partials/widgets/pagination.pug

0 comments on commit 63c1473

Please sign in to comment.