|
8 | 8 | <meta name="author" content="{{ site.author }}">
|
9 | 9 | {% endif %}
|
10 | 10 |
|
11 |
| - {% if page.description %} |
12 |
| - <meta name="description" content="{{ page.description }}"> |
13 |
| - {% elsif page.subtitle %} |
14 |
| - <meta name="description" content="{{ page.subtitle }}"> |
15 |
| - {% elsif site.description %} |
16 |
| - <meta name="description" content="{{ site.description }}"> |
17 |
| - {% endif %} |
| 11 | + {%- capture description -%} |
| 12 | + {%- if page.description -%} |
| 13 | + {{ page.description }} |
| 14 | + {%- elsif page.subtitle -%} |
| 15 | + {{ page.subtitle }} |
| 16 | + {%- else -%} |
| 17 | + {{ site.description }} |
| 18 | + {%- endif -%} |
| 19 | + {%- endcapture -%} |
| 20 | + <meta name="description" content="{{ description }}"> |
18 | 21 |
|
19 | 22 | {% if site.mobile-theme-col %}
|
20 | 23 | <meta name="theme-color" content="{{ site.mobile-theme-col }}">
|
|
42 | 45 | {% endfor %}
|
43 | 46 | {% endif %}
|
44 | 47 |
|
45 |
| - {% if page.ext-css %} |
46 |
| - {% for css in page.ext-css %} |
47 |
| - {% include ext-css.html css=css %} |
48 |
| - {% endfor %} |
49 |
| - {% endif %} |
50 |
| - |
51 | 48 | {% if site.site-css %}
|
52 | 49 | {% for css in site.site-css %}
|
53 | 50 | <link rel="stylesheet" href="{{ css | relative_url }}">
|
54 | 51 | {% endfor %}
|
55 | 52 | {% endif %}
|
| 53 | + |
| 54 | + {% if page.ext-css %} |
| 55 | + {% for css in page.ext-css %} |
| 56 | + {% include ext-css.html css=css %} |
| 57 | + {% endfor %} |
| 58 | + {% endif %} |
56 | 59 |
|
57 | 60 | {% if page.css %}
|
58 | 61 | {% for css in page.css %}
|
59 | 62 | <link rel="stylesheet" href="{{ css | relative_url }}">
|
60 | 63 | {% endfor %}
|
61 | 64 | {% endif %}
|
62 | 65 |
|
63 |
| - <!-- Facebook OpenGraph tags --> |
64 | 66 | {% if site.fb_app_id %}
|
65 | 67 | <meta property="fb:app_id" content="{{ site.fb_app_id }}">
|
66 | 68 | {% endif %}
|
|
69 | 71 | <meta property="og:site_name" content="{{ site.title }}">
|
70 | 72 | {% endif %}
|
71 | 73 |
|
72 |
| - {% if page.meta-title %} |
73 |
| - <meta property="og:title" content="{{ page.meta-title }}"> |
74 |
| - {% elsif page.title %} |
75 |
| - <meta property="og:title" content="{{ page.title }}"> |
76 |
| - {% elsif site.title %} |
77 |
| - <meta property="og:title" content="{{ site.title }}"> |
78 |
| - {% endif %} |
| 74 | + {%- capture share-title -%} |
| 75 | + {%- if page.meta-title -%} |
| 76 | + {{ page.meta-title }} |
| 77 | + {%- elsif page.title -%} |
| 78 | + {{ page.title }} |
| 79 | + {%- else -%} |
| 80 | + {{ site.title }} |
| 81 | + {%- endif -%} |
| 82 | + {%- endcapture -%} |
| 83 | + |
| 84 | + {%- capture share-description -%} |
| 85 | + {%- if page.meta-description -%} |
| 86 | + {{ page.meta-description }} |
| 87 | + {%- elsif page.subtitle -%} |
| 88 | + {{ page.subtitle }} |
| 89 | + {%- else -%} |
| 90 | + {{ {{ page.content | strip_html | xml_escape | truncatewords: 50 }} }} |
| 91 | + {%- endif -%} |
| 92 | + {%- endcapture -%} |
| 93 | + |
| 94 | + {%- capture share-img -%} |
| 95 | + {%- if page.share-img -%} |
| 96 | + {{ page.share-img }} |
| 97 | + {%- elsif page.cover-img -%} |
| 98 | + {%- if page.cover-img.first -%} |
| 99 | + {{ page.cover-img[0].first.first }} |
| 100 | + {%- else -%} |
| 101 | + {{ page.cover-img }} |
| 102 | + {%- endif -%} |
| 103 | + {%- elsif page.thumbnail-img -%} |
| 104 | + {{ page.thumbnail-img }} |
| 105 | + {%- elsif site.avatar -%} |
| 106 | + {{ site.avatar }} |
| 107 | + {% endif %} |
| 108 | + {%- endcapture -%} |
| 109 | + {%- assign share-img=share-img | strip -%} |
79 | 110 |
|
80 |
| - {% if page.meta-description %} |
81 |
| - <meta property="og:description" content="{{ page.meta-description }}"> |
82 |
| - {% elsif page.subtitle %} |
83 |
| - <meta property="og:description" content="{{ page.subtitle }}"> |
84 |
| - {% else %} |
85 |
| - <meta property="og:description" content="{{ page.content | strip_html | xml_escape | truncatewords: 50 }}"> |
86 |
| - {% endif %} |
| 111 | + <meta property="og:title" content="{{ share-title }}"> |
| 112 | + <meta property="og:description" content="{{ share-description }}"> |
87 | 113 |
|
| 114 | + {% if share-img != "" %} |
| 115 | + <meta property="og:image" content="{{ share-img | absolute_url }}"> |
| 116 | + {% endif %} |
88 | 117 |
|
89 | 118 | {% if page.id %}
|
90 | 119 | <meta property="og:type" content="article">
|
|
102 | 131 | <link rel="canonical" href="{{ page.url | absolute_url | strip_index }}">
|
103 | 132 | {% endif %}
|
104 | 133 |
|
105 |
| - {%- capture shareimg -%} |
106 |
| - {% if page.share-img %} |
107 |
| - {{ page.share-img }} |
108 |
| - {% elsif page.cover-img %} |
109 |
| - {% if page.cover-img.first %} |
110 |
| - {{ page.cover-img[0].first.first }} |
111 |
| - {% else %} |
112 |
| - {{ page.cover-img }} |
113 |
| - {% endif %} |
114 |
| - {% elsif page.thumbnail-img %} |
115 |
| - {{ page.thumbnail-img }} |
116 |
| - {% elsif site.avatar %} |
117 |
| - {{ site.avatar }} |
118 |
| - {% endif %} |
119 |
| - {% endcapture %} |
120 |
| - {% assign shareimg=shareimg | strip %} |
121 |
| - |
122 |
| - {% if shareimg != "" %} |
123 |
| - <meta property="og:image" content="{{ shareimg | absolute_url }}"> |
124 |
| - {% endif %} |
125 |
| - |
126 | 134 |
|
127 |
| - <!-- Twitter summary cards --> |
128 |
| - {% if shareimg != "" and shareimg != site.avatar %} |
| 135 | + {% if share-img != "" and share-img != site.avatar %} |
129 | 136 | <meta name="twitter:card" content="summary_large_image">
|
130 | 137 | {% else %}
|
131 | 138 | <meta name="twitter:card" content="summary">
|
132 | 139 | {% endif %}
|
133 | 140 | <meta name="twitter:site" content="@{{ site.social-network-links.twitter }}">
|
134 | 141 | <meta name="twitter:creator" content="@{{ site.social-network-links.twitter }}">
|
135 | 142 |
|
136 |
| - {% if page.meta-title %} |
137 |
| - <meta name="twitter:title" content="{{ page.meta-title }}"> |
138 |
| - {% elsif page.title %} |
139 |
| - <meta name="twitter:title" content="{{ page.title }}"> |
140 |
| - {% else %} |
141 |
| - <meta name="twitter:title" content="{{ site.title }}"> |
142 |
| - {% endif %} |
143 |
| - |
144 |
| - {% if page.meta-description %} |
145 |
| - <meta name="twitter:description" content="{{ page.meta-description }}"> |
146 |
| - {% elsif page.subtitle %} |
147 |
| - <meta name="twitter:description" content="{{ page.subtitle }}"> |
148 |
| - {% else %} |
149 |
| - <meta name="twitter:description" content="{{ page.content | strip_html | xml_escape | truncatewords: 50 }}"> |
150 |
| - {% endif %} |
| 143 | + <meta property="twitter:title" content="{{ share-title }}"> |
| 144 | + <meta property="twitter:description" content="{{ share-description }}"> |
151 | 145 |
|
152 |
| - {% if shareimg != "" %} |
153 |
| - <meta name="twitter:image" content="{{ shareimg | absolute_url }}"> |
| 146 | + {% if share-img != "" %} |
| 147 | + <meta name="twitter:image" content="{{ share-img | absolute_url }}"> |
154 | 148 | {% endif %}
|
155 | 149 |
|
156 | 150 | {% if site.matomo %}
|
157 | 151 | {% include matomo.html %}
|
158 | 152 | {% endif %}
|
159 | 153 |
|
160 | 154 | {% if page.comments and site.staticman.repository and site.staticman.branch %}
|
161 |
| - <!-- Staticman --> |
162 | 155 | <link rel="stylesheet" href="{{ "/assets/css/staticman.css" | relative_url }}">
|
163 | 156 | {% endif %}
|
164 | 157 |
|
|
0 commit comments