{%- assign default_paths = site.pages | map: "path" -%} {%- assign page_paths = site.header_pages | default: default_paths -%} {%- assign titles_size = site.pages | map: 'title' | join: '' | size -%} {%- if page.layout == 'home' -%} {{ site.title }} {%- else -%} {{ site.title }} {%- endif -%} {%- if titles_size > 0 -%} {%- for path in page_paths -%} {%- assign page = site.pages | where: "path", path | first -%} {%- if page.title -%} {{ page.title | escape }} {%- endif -%} {%- endfor -%} {%- endif -%}