head.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <head>
  2. <meta charset="utf-8" />
  3. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  5. <title>{% if page.use-site-title %}{{ site.title }} {{ site.title-separator }} {{ site.description }}{% elsif page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
  6. <meta name="author" content="{{ site.author.name }}" />
  7. {% if page.subtitle %}
  8. <meta name="description" content="{{ page.subtitle }}">
  9. {% endif %}
  10. <link rel="alternate" type="application/rss+xml" title="{{ site.title }} {{ site.title-separator }} {{ site.description }}" href="{{ site.baseurl }}/feed.xml" />
  11. {% include gtm_head.html %}
  12. {% include google_analytics.html %}
  13. {% if layout.common-ext-css %}
  14. {% for css in layout.common-ext-css %}
  15. {% include ext-css.html css=css %}
  16. {% endfor %}
  17. {% endif %}
  18. {% if layout.common-css %}
  19. {% for css in layout.common-css %}
  20. <link rel="stylesheet" href="{{ css | prepend: site.baseurl | replace: '//', '/' }}" />
  21. {% endfor %}
  22. {% endif %}
  23. {% if layout.common-googlefonts %}
  24. {% for font in layout.common-googlefonts %}
  25. <link rel="stylesheet" href="//fonts.googleapis.com/css?family={{ font }}" />
  26. {% endfor %}
  27. {% endif %}
  28. {% if page.ext-css %}
  29. {% for css in page.ext-css %}
  30. {% include ext-css.html css=css %}
  31. {% endfor %}
  32. {% endif %}
  33. {% if page.css %}
  34. {% for css in page.css %}
  35. <link rel="stylesheet" href="{{ css | prepend: site.baseurl | replace: '//', '/' }}" />
  36. {% endfor %}
  37. {% endif %}
  38. {% if page.googlefonts %}
  39. {% for font in page.googlefonts %}
  40. <link rel="stylesheet" href="//fonts.googleapis.com/css?family={{ font }}" />
  41. {% endfor %}
  42. {% endif %}
  43. <!-- Facebook OpenGraph tags -->
  44. {% if site.fb_app_id %}
  45. <meta property="fb:app_id" content="{{ site.fb_app_id }}" />
  46. {% endif %}
  47. {% if page.meta-title %}
  48. <meta property="og:title" content="{{ page.meta-title }}" />
  49. {% elsif page.title %}
  50. <meta property="og:title" content="{{ page.title }}" />
  51. {% else %}
  52. <meta property="og:title" content="{{ site.title }}" />
  53. {% endif %}
  54. {% if page.meta-description %}
  55. <meta property="og:description" content="{{ page.meta-description }}">
  56. {% elsif page.subtitle %}
  57. <meta property="og:description" content="{{ page.subtitle }}">
  58. {% else %}
  59. <meta property="og:description" content="{{ page.content | strip_html | xml_escape | truncatewords: 50 }}">
  60. {% endif %}
  61. <meta property="og:type" content="website" />
  62. {% if page.id %}
  63. <meta property="og:url" content="{{ site.url }}{{ page.url }}" />
  64. <link rel="canonical" href="{{ site.url }}{{ page.url }}" />
  65. {% else %}
  66. <meta property="og:url" content="{{ site.url }}{{ page.url | remove: '/index.html' | remove: '.html' }}" />
  67. <link rel="canonical" href="{{ site.url }}{{ page.url | remove: '/index.html' | remove: '.html' }}" />
  68. {% endif %}
  69. {% if page.share-img %}
  70. <meta property="og:image" content="{{ page.share-img }}" />
  71. {% elsif site.avatar %}
  72. <meta property="og:image" content="{{ site.url }}{{ site.avatar }}" />
  73. {% endif %}
  74. <!-- Twitter summary cards -->
  75. <meta name="twitter:card" content="summary" />
  76. <meta name="twitter:site" content="@{{ site.author.twitter }}" />
  77. <meta name="twitter:creator" content="@{{ site.author.twitter }}" />
  78. {% if page.meta-title %}
  79. <meta name="twitter:title" content="{{ page.meta-title }}" />
  80. {% elsif page.title %}
  81. <meta name="twitter:title" content="{{ page.title }}" />
  82. {% else %}
  83. <meta name="twitter:title" content="{{ site.title }}" />
  84. {% endif %}
  85. {% if page.meta-description %}
  86. <meta name="twitter:description" content="{{ page.meta-description }}">
  87. {% elsif page.subtitle %}
  88. <meta name="twitter:description" content="{{ page.subtitle }}">
  89. {% else %}
  90. <meta name="twitter:description" content="{{ page.content | strip_html | xml_escape | truncatewords: 50 }}">
  91. {% endif %}
  92. {% if page.share-img %}
  93. <meta name="twitter:image" content="{{ page.share-img }}" />
  94. {% elsif site.avatar %}
  95. <meta name="twitter:image" content="{{ site.url }}{{ site.avatar }}" />
  96. {% endif %}
  97. {% if site.matomo %}
  98. {% include matomo.html %}
  99. {% endif %}
  100. </head>