blog/_includes/functions.html

31 lines
835 B
HTML
Raw Permalink Normal View History

2020-09-29 06:54:54 +02:00
{%- assign params = include -%}
{%- if params.func -%}
{%- assign func = params.func -%}
2019-09-11 06:19:34 +02:00
{%- endif -%}
{%- assign include_path = func -%}
{%- assign path_array = include_path | split: '.' -%}
{%- if path_array.size == 1 -%}
{%- assign include_path = include_path | append: '.html' -%}
{%- endif -%}
{%- if func == 'log' -%}
{%- include functions/log.html level=include.level msg=include.msg -%}
{%- else -%}
{%- assign include_path = 'functions/' | append: include_path -%}
2020-09-29 06:54:54 +02:00
{%- include {{ include_path }} params=params-%}
2019-09-11 06:19:34 +02:00
{%- endif -%}
{%- if return == nil -%}
{%- assign return = include.default -%}
{%- endif -%}
2019-09-11 06:19:34 +02:00
{%- if func != 'log' -%}
{%- assign msg = '[function]['
| append: {{func}}
| append: '] '
| append: {{return}}
-%}
{%- include functions.html func='log' level='info' -%}
{%- endif -%}