fix: some function params not working

This commit is contained in:
jeffreytse 2020-09-29 12:54:54 +08:00
parent 0e8b292bd0
commit a7d8a2977d
5 changed files with 24 additions and 23 deletions

View file

@ -1,5 +1,6 @@
{%- if include.func -%}
{%- assign func = include.func -%}
{%- assign params = include -%}
{%- if params.func -%}
{%- assign func = params.func -%}
{%- endif -%}
{%- assign include_path = func -%}
@ -12,7 +13,7 @@
{%- include functions/log.html level=include.level msg=include.msg -%}
{%- else -%}
{%- assign include_path = 'functions/' | append: include_path -%}
{%- include {{ include_path }} -%}
{%- include {{ include_path }} params=params-%}
{%- endif -%}
{%- if func != 'log' -%}

View file

@ -1,5 +1,5 @@
{% if include.filter %}
{% assign filter = include.filter %}
{% if include.params.filter %}
{% assign filter = include.params.filter %}
{% endif %}
{% assign split_mark = '<|>' %}

View file

@ -1,9 +1,9 @@
{% if include.article %}
{% assign article = include.article %}
{% if include.params.article %}
{% assign article = include.params.article %}
{% endif %}
{% if include.speed %}
{% assign speed = include.speed %}
{% if include.params.speed %}
{% assign speed = include.params.speed %}
{% else %}
{% assign speed = 160 %}
{% endif %}

View file

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

View file

@ -1,9 +1,9 @@
{% if include.level %}
{% assign level = include.level %}
{% if include.params.level %}
{% assign level = include.params.level %}
{% endif %}
{% if include.msg %}
{% assign msg = include.msg %}
{% if include.params.msg %}
{% assign msg = include.params.msg %}
{% endif %}
{% if site.debug == true %}