blog/_includes/functions/get_value.html
2020-09-29 12:54:54 +08:00

19 lines
689 B
HTML

{%- if include.params.name -%}
{%- assign name = include.params.name -%}
{%- endif -%}
{%- if page[name] != nil -%}
{%- assign return = page[name] -%}
{%- elsif site[name] != nil -%}
{%- assign return = site[name] -%}
{%- elsif site.data[name] != nil -%}
{%- assign return = site.data[name] -%}
{%- elsif site.defaults[page.layout][name] != nil -%}
{%- assign return = site.defaults[page.layout][name] -%}
{%- elsif site.data.defaults[page.layout][name] != nil -%}
{%- assign return = site.data.defaults[page.layout][name] -%}
{%- elsif layout[name] != nil -%}
{%- assign return = layout[name] -%}
{%- else -%}
{%- assign return = include.params.default -%}
{%- endif -%}