head.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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, viewport-fit=cover">
  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="{{ '/feed.xml' | absolute_url }}" />
  11. {% include gtag.html %}
  12. {% include gtm_head.html %}
  13. {% include google_analytics.html %}
  14. {% if layout.common-ext-css %}
  15. {% for css in layout.common-ext-css %}
  16. {% include ext-css.html css=css %}
  17. {% endfor %}
  18. {% endif %}
  19. {% if layout.common-css %}
  20. {% for css in layout.common-css %}
  21. <link rel="stylesheet" href="{{ css | relative_url }}" />
  22. {% endfor %}
  23. {% endif %}
  24. {% if layout.common-googlefonts %}
  25. {% for font in layout.common-googlefonts %}
  26. <link rel="stylesheet" href="//fonts.googleapis.com/css?family={{ font }}" />
  27. {% endfor %}
  28. {% endif %}
  29. {% if page.ext-css %}
  30. {% for css in page.ext-css %}
  31. {% include ext-css.html css=css %}
  32. {% endfor %}
  33. {% endif %}
  34. {% if page.css %}
  35. {% for css in page.css %}
  36. <link rel="stylesheet" href="{{ css | relative_url }}" />
  37. {% endfor %}
  38. {% endif %}
  39. {% if page.googlefonts %}
  40. {% for font in page.googlefonts %}
  41. <link rel="stylesheet" href="//fonts.googleapis.com/css?family={{ font }}" />
  42. {% endfor %}
  43. {% endif %}
  44. <!-- Facebook OpenGraph tags -->
  45. {% if site.fb_app_id %}
  46. <meta property="fb:app_id" content="{{ site.fb_app_id }}" />
  47. {% endif %}
  48. {% if page.meta-title %}
  49. <meta property="og:title" content="{{ page.meta-title }}" />
  50. {% elsif page.title %}
  51. <meta property="og:title" content="{{ page.title }}" />
  52. {% else %}
  53. <meta property="og:title" content="{{ site.title }}" />
  54. {% endif %}
  55. {% if page.meta-description %}
  56. <meta property="og:description" content="{{ page.meta-description }}">
  57. {% elsif page.subtitle %}
  58. <meta property="og:description" content="{{ page.subtitle }}">
  59. {% else %}
  60. <meta property="og:description" content="{{ page.content | strip_html | xml_escape | truncatewords: 50 }}">
  61. {% endif %}
  62. <meta property="og:type" content="website" />
  63. {% if page.id %}
  64. <meta property="og:url" content="{{ page.url | absolute_url }}" />
  65. <link rel="canonical" href="{{ page.url | absolute_url }}" />
  66. {% else %}
  67. <meta property="og:url" content="{{ page.url | absolute_url | strip_index }}" />
  68. <link rel="canonical" href="{{ page.url | absolute_url | strip_index }}" />
  69. {% endif %}
  70. {% if page.share-img %}
  71. <meta property="og:image" content="{{ page.share-img }}" />
  72. {% elsif site.avatar %}
  73. <meta property="og:image" content="{{ site.avatar | absolute_url }}" />
  74. {% endif %}
  75. <!-- Twitter summary cards -->
  76. <meta name="twitter:card" content="summary" />
  77. <meta name="twitter:site" content="@{{ site.author.twitter }}" />
  78. <meta name="twitter:creator" content="@{{ site.author.twitter }}" />
  79. {% if page.meta-title %}
  80. <meta name="twitter:title" content="{{ page.meta-title }}" />
  81. {% elsif page.title %}
  82. <meta name="twitter:title" content="{{ page.title }}" />
  83. {% else %}
  84. <meta name="twitter:title" content="{{ site.title }}" />
  85. {% endif %}
  86. {% if page.meta-description %}
  87. <meta name="twitter:description" content="{{ page.meta-description }}">
  88. {% elsif page.subtitle %}
  89. <meta name="twitter:description" content="{{ page.subtitle }}">
  90. {% else %}
  91. <meta name="twitter:description" content="{{ page.content | strip_html | xml_escape | truncatewords: 50 }}">
  92. {% endif %}
  93. {% if page.share-img %}
  94. <meta name="twitter:image" content="{{ page.share-img }}" />
  95. {% elsif site.avatar %}
  96. <meta name="twitter:image" content="{{ site.avatar | absolute_url }}" />
  97. {% endif %}
  98. {% if site.matomo %}
  99. {% include matomo.html %}
  100. {% endif %}
  101. {% if page.comments and site.staticman.repository and site.staticman.branch %}
  102. <!-- Staticman -->
  103. <link rel="stylesheet" href="{{ "/css/staticman.css" | relative_url }}" />
  104. {% endif %}
  105. </head>