From a7d8a2977d6110d1f8778b8ae02067982a5e43a7 Mon Sep 17 00:00:00 2001 From: jeffreytse Date: Tue, 29 Sep 2020 12:54:54 +0800 Subject: fix: some function params not working --- _includes/functions/get_value.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to '_includes/functions/get_value.html') diff --git a/_includes/functions/get_value.html b/_includes/functions/get_value.html index 17561a2..5b1dbc4 100644 --- a/_includes/functions/get_value.html +++ b/_includes/functions/get_value.html @@ -1,19 +1,19 @@ -{%- if include.name -%} - {%- assign name = include.name -%} +{%- if include.params.name -%} + {%- assign name = include.params.name -%} {%- endif -%} -{%- assign return = include.return -%} - -{%- if page[name] -%} +{%- if page[name] != nil -%} {%- assign return = page[name] -%} -{%- elsif site[name] -%} +{%- elsif site[name] != nil -%} {%- assign return = site[name] -%} -{%- elsif site.data[name] -%} +{%- elsif site.data[name] != nil -%} {%- assign return = site.data[name] -%} -{%- elsif site.defaults[page.layout][name] -%} +{%- elsif site.defaults[page.layout][name] != nil -%} {%- assign return = site.defaults[page.layout][name] -%} -{%- elsif site.data.defaults[page.layout][name] -%} +{%- elsif site.data.defaults[page.layout][name] != nil -%} {%- assign return = site.data.defaults[page.layout][name] -%} -{%- elsif layout[name] -%} +{%- elsif layout[name] != nil -%} {%- assign return = layout[name] -%} +{%- else -%} + {%- assign return = include.params.default -%} {%- endif -%} -- cgit v1.2.3