{% capture pagetitle %} {%- if page.share-title -%} {{ page.share-title | strip_html | xml_escape }} {%- elsif page.title -%} {{ page.title | strip_html | xml_escape }} {%- else -%} {{ site.title | strip_html | xml_escape }} {%- endif -%} {% endcapture %} {% capture title %} {%- if site.title and site.title-on-all-pages and (site.title != pagetitle) -%} {{ pagetitle }} | {{ site.title }} {%- else -%} {{ pagetitle }} {%- endif -%} {% endcapture %} {% capture description %} {%- if page.share-description -%} {{ page.share-description | strip_html | xml_escape }} {%- elsif page.subtitle -%} {{ page.subtitle | strip_html | xml_escape }} {%- else -%} {%- assign excerpt_length = site.excerpt_length | default: 50 -%} {{ page.content | strip_html | xml_escape | truncatewords: excerpt_length | strip }} {%- endif -%} {% endcapture %}