summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeffreytse <jeffreytse.mail@gmail.com>2020-08-25 14:25:00 +0800
committerjeffreytse <jeffreytse.mail@gmail.com>2020-08-25 14:25:00 +0800
commit625fb13e122d1642b2a5c6760f28212550aaa7a5 (patch)
tree4625550072492b75bedf723432fc3576912c4c63
parent20afd2fecd7d4d76ca4b34ebe43e1149f5185966 (diff)
feat: add hidden front-matter for post layout
-rw-r--r--_layouts/post.html12
1 files changed, 11 insertions, 1 deletions
diff --git a/_layouts/post.html b/_layouts/post.html
index bd1f93d..ed045ec 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -13,12 +13,15 @@ sidebar:
{%- include functions.html func='get_value' -%}
{%- assign banner = return -%}
- {%- if banner == nil -%}
+ {%- assign result = page.hidden | where_exp: "item", "item == 'header'" -%}
+ {%- if banner == nil and result.size == 0 -%}
{%- include views/post-header.html -%}
{%- endif -%}
{%- include views/article.html -%}
+ {%- assign result = page.hidden | where_exp: "item", "item == 'navigator'" -%}
+ {%- if result.size == 0 -%}
<div class="post-nav">
{%- if page.previous -%}
<a class="previous" href="{{ page.previous.url }}" title="{{
@@ -33,7 +36,10 @@ sidebar:
<span></span>
{%- endif -%}
</div>
+ {%- endif -%}
+ {%- assign result = page.hidden | where_exp: "item", "item == 'related_posts'" -%}
+ {%- if result.size == 0 -%}
<div class="post-related">
<div>Related Articles</div>
<ul>
@@ -43,7 +49,10 @@ sidebar:
{%- endfor -%}
</ul>
</div>
+ {%- endif -%}
+ {%- assign result = page.hidden | where_exp: "item", "item == 'comments'" -%}
+ {%- if result.size == 0 -%}
<div class="post-comments">
{%- if page.comments != false -%}
@@ -57,6 +66,7 @@ sidebar:
{%- endif -%}
</div>
+ {%- endif -%}
</section>
</div>