diff --git a/_includes/head.html b/_includes/head.html index 6c29ce5..6f172e0 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -8,13 +8,16 @@ {% endif %} - {% if page.description %} - - {% elsif page.subtitle %} - - {% elsif site.description %} - - {% endif %} + {%- capture description -%} + {%- if page.description -%} + {{ page.description }} + {%- elsif page.subtitle -%} + {{ page.subtitle }} + {%- else -%} + {{ site.description }} + {%- endif -%} + {%- endcapture -%} + {% if site.mobile-theme-col %} @@ -42,17 +45,17 @@ {% endfor %} {% endif %} - {% if page.ext-css %} - {% for css in page.ext-css %} - {% include ext-css.html css=css %} - {% endfor %} - {% endif %} - {% if site.site-css %} {% for css in site.site-css %} {% endfor %} {% endif %} + + {% if page.ext-css %} + {% for css in page.ext-css %} + {% include ext-css.html css=css %} + {% endfor %} + {% endif %} {% if page.css %} {% for css in page.css %} @@ -60,7 +63,6 @@ {% endfor %} {% endif %} - {% if site.fb_app_id %} {% endif %} @@ -69,22 +71,49 @@ {% endif %} - {% if page.meta-title %} - - {% elsif page.title %} - - {% elsif site.title %} - - {% endif %} + {%- capture share-title -%} + {%- if page.meta-title -%} + {{ page.meta-title }} + {%- elsif page.title -%} + {{ page.title }} + {%- else -%} + {{ site.title }} + {%- endif -%} + {%- endcapture -%} - {% if page.meta-description %} - - {% elsif page.subtitle %} - - {% else %} - - {% endif %} + {%- capture share-description -%} + {%- if page.meta-description -%} + {{ page.meta-description }} + {%- elsif page.subtitle -%} + {{ page.subtitle }} + {%- else -%} + {{ {{ page.content | strip_html | xml_escape | truncatewords: 50 }} }} + {%- endif -%} + {%- endcapture -%} + {%- capture share-img -%} + {%- if page.share-img -%} + {{ page.share-img }} + {%- elsif page.cover-img -%} + {%- if page.cover-img.first -%} + {{ page.cover-img[0].first.first }} + {%- else -%} + {{ page.cover-img }} + {%- endif -%} + {%- elsif page.thumbnail-img -%} + {{ page.thumbnail-img }} + {%- elsif site.avatar -%} + {{ site.avatar }} + {% endif %} + {%- endcapture -%} + {%- assign share-img=share-img | strip -%} + + + + + {% if share-img != "" %} + + {% endif %} {% if page.id %} @@ -102,30 +131,8 @@ {% endif %} - {%- capture shareimg -%} - {% if page.share-img %} - {{ page.share-img }} - {% elsif page.cover-img %} - {% if page.cover-img.first %} - {{ page.cover-img[0].first.first }} - {% else %} - {{ page.cover-img }} - {% endif %} - {% elsif page.thumbnail-img %} - {{ page.thumbnail-img }} - {% elsif site.avatar %} - {{ site.avatar }} - {% endif %} - {% endcapture %} - {% assign shareimg=shareimg | strip %} - {% if shareimg != "" %} - - {% endif %} - - - - {% if shareimg != "" and shareimg != site.avatar %} + {% if share-img != "" and share-img != site.avatar %} {% else %} @@ -133,24 +140,11 @@ - {% if page.meta-title %} - - {% elsif page.title %} - - {% else %} - - {% endif %} + + - {% if page.meta-description %} - - {% elsif page.subtitle %} - - {% else %} - - {% endif %} - - {% if shareimg != "" %} - + {% if share-img != "" %} + {% endif %} {% if site.matomo %} @@ -158,7 +152,6 @@ {% endif %} {% if page.comments and site.staticman.repository and site.staticman.branch %} - {% endif %} diff --git a/_layouts/base.html b/_layouts/base.html index bf7b5b4..59e6cd1 100644 --- a/_layouts/base.html +++ b/_layouts/base.html @@ -21,20 +21,20 @@ common-js: - - {% include head.html %} + +{% include head.html %} - + - {% include gtm_body.html %} + {% include gtm_body.html %} - {% include nav.html %} + {% include nav.html %} - {{ content }} + {{ content }} - {% include footer.html %} + {% include footer.html %} - {% include footer-scripts.html %} + {% include footer-scripts.html %} - +