From 2a02157ad66da2159dd605326a3829f5e7fa6b73 Mon Sep 17 00:00:00 2001 From: jeffreytse Date: Tue, 25 Aug 2020 14:41:46 +0800 Subject: [PATCH] fix: hidden front-matter not working --- _layouts/post.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/_layouts/post.html b/_layouts/post.html index ed045ec..c515f6a 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -13,14 +13,18 @@ sidebar: {%- include functions.html func='get_value' -%} {%- assign banner = return -%} - {%- assign result = page.hidden | where_exp: "item", "item == 'header'" -%} + {%- assign name = 'hidden' -%} + {%- include functions.html func='get_value' -%} + {%- assign hidden = return -%} + + {%- assign result = 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'" -%} + {%- assign result = hidden | where_exp: "item", "item == 'navigator'" -%} {%- if result.size == 0 -%}
{%- if page.previous -%} @@ -38,7 +42,7 @@ sidebar:
{%- endif -%} - {%- assign result = page.hidden | where_exp: "item", "item == 'related_posts'" -%} + {%- assign result = hidden | where_exp: "item", "item == 'related_posts'" -%} {%- if result.size == 0 -%}
Related Articles
@@ -51,7 +55,7 @@ sidebar:
{%- endif -%} - {%- assign result = page.hidden | where_exp: "item", "item == 'comments'" -%} + {%- assign result = hidden | where_exp: "item", "item == 'comments'" -%} {%- if result.size == 0 -%}
{%- if page.comments != false -%}