sources for https://poweris.moe/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
4.4KB

  1. <head>
  2. <meta charset="utf-8">
  3. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  4. {% capture title %}
  5. {%- if page.share-title -%}
  6. {{ page.share-title | strip_html | xml_escape }}
  7. {%- elsif page.title -%}
  8. {{ page.title | strip_html | xml_escape }}
  9. {%- else -%}
  10. {{ site.title | strip_html | xml_escape }}
  11. {%- endif -%}
  12. {% endcapture %}
  13. {% capture description %}
  14. {%- if page.share-description -%}
  15. {{ page.share-description | strip_html | xml_escape }}
  16. {%- elsif page.subtitle -%}
  17. {{ page.subtitle | strip_html | xml_escape }}
  18. {%- else -%}
  19. {%- assign excerpt_length = site.excerpt_length | default: 50 -%}
  20. {{ page.content | strip_html | xml_escape | truncatewords: excerpt_length | strip }}
  21. {%- endif -%}
  22. {% endcapture %}
  23. <title>{{ title }}</title>
  24. {% if site.author %}
  25. <meta name="author" content="{{ site.author }}">
  26. {% endif %}
  27. <meta name="description" content="{{ description }}">
  28. {% if site.mobile-theme-col %}
  29. <meta name="theme-color" content="{{ site.mobile-theme-col }}">
  30. {% endif %}
  31. {% if site.keywords %}
  32. <meta name="keywords" content="{{ site.keywords }}">
  33. {% endif %}
  34. <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ '/feed.xml' | absolute_url }}">
  35. {% include gtag.html %}
  36. {% include gtm_head.html %}
  37. {% include google_analytics.html %}
  38. {% if layout.common-ext-css %}
  39. {% for css in layout.common-ext-css %}
  40. {% include ext-css.html css=css %}
  41. {% endfor %}
  42. {% endif %}
  43. {% if layout.common-css %}
  44. {% for css in layout.common-css %}
  45. <link rel="stylesheet" href="{{ css | relative_url }}">
  46. {% endfor %}
  47. {% endif %}
  48. {% if site.site-css %}
  49. {% for css in site.site-css %}
  50. <link rel="stylesheet" href="{{ css | relative_url }}">
  51. {% endfor %}
  52. {% endif %}
  53. {% if page.ext-css %}
  54. {% for css in page.ext-css %}
  55. {% include ext-css.html css=css %}
  56. {% endfor %}
  57. {% endif %}
  58. {% if page.css %}
  59. {% for css in page.css %}
  60. <link rel="stylesheet" href="{{ css | relative_url }}">
  61. {% endfor %}
  62. {% endif %}
  63. {% if site.fb_app_id %}
  64. <meta property="fb:app_id" content="{{ site.fb_app_id }}">
  65. {% endif %}
  66. {% if site.title %}
  67. <meta property="og:site_name" content="{{ site.title }}">
  68. {% endif %}
  69. {%- capture img -%}
  70. {%- if page.share-img -%}
  71. {{ page.share-img }}
  72. {%- elsif page.cover-img -%}
  73. {%- if page.cover-img.first -%}
  74. {{ page.cover-img[0].first.first }}
  75. {%- else -%}
  76. {{ page.cover-img }}
  77. {%- endif -%}
  78. {%- elsif page.thumbnail-img -%}
  79. {{ page.thumbnail-img }}
  80. {%- elsif site.avatar -%}
  81. {{ site.avatar }}
  82. {% endif %}
  83. {%- endcapture -%}
  84. {%- assign img=img | strip -%}
  85. <meta property="og:title" content="{{ title }}">
  86. <meta property="og:description" content="{{ description }}">
  87. {% if img != "" %}
  88. <meta property="og:image" content="{{ img | absolute_url }}">
  89. {% endif %}
  90. {% if page.id %}
  91. <meta property="og:type" content="article">
  92. <meta property="og:article:author" content="{{ site.author }}">
  93. <meta property="og:article:published_time" content="{{ page.date | date_to_xmlschema }}">
  94. <meta property="og:url" content="{{ page.url | absolute_url }}">
  95. <link rel="canonical" href="{{ page.url | absolute_url }}">
  96. {% else %}
  97. <meta property="og:type" content="website">
  98. <meta property="og:url" content="{{ page.url | absolute_url | strip_index }}">
  99. <link rel="canonical" href="{{ page.url | absolute_url | strip_index }}">
  100. {% endif %}
  101. {% if img != "" and img != site.avatar %}
  102. <meta name="twitter:card" content="summary_large_image">
  103. {% else %}
  104. <meta name="twitter:card" content="summary">
  105. {% endif %}
  106. <meta name="twitter:site" content="@{{ site.social-network-links.twitter }}">
  107. <meta name="twitter:creator" content="@{{ site.social-network-links.twitter }}">
  108. <meta property="twitter:title" content="{{ title }}">
  109. <meta property="twitter:description" content="{{ description }}">
  110. {% if img != "" %}
  111. <meta name="twitter:image" content="{{ img | absolute_url }}">
  112. {% endif %}
  113. {% include matomo.html %}
  114. {% if page.comments and site.staticman.repository and site.staticman.branch %}
  115. <link rel="stylesheet" href="{{ "/assets/css/staticman.css" | relative_url }}">
  116. {% endif %}
  117. {% if page.head-extra %}
  118. {% for file in page.head-extra %}
  119. {% include {{ file }} %}
  120. {% endfor %}
  121. {% endif %}
  122. </head>