summaryrefslogtreecommitdiff
path: root/_includes/functions/get_value.html
blob: 5b1dbc464e2cee69dfc1857eedd101e01f14c380 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{%- 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 -%}