feat: add hidden front-matter for post layout

This commit is contained in:
jeffreytse 2020-08-25 14:25:00 +08:00
parent 20afd2fecd
commit 625fb13e12

View file

@ -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>