-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog-template.liquid
372 lines (347 loc) · 13.1 KB
/
blog-template.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
{% paginate blog.articles by 12 %}
<div class="page-width">
<header class="section-header text-center">
<h1>{{ page_title }}</h1>
{% if blog.tags.size > 0 %}
<div class="blog-filter">
<label class="blog-filter__label select-label" for="BlogTagFilter">{{ 'collections.filters.title_tags' | t }}</label>
<div class="select-group">
<select id="BlogTagFilter" aria-describedby="a11y-refresh-page-message a11y-selection-message" data-blog-tag-filter>
<option value="{{ blog.url }}">{{ 'blogs.article.all_topics' | t }}</option>
{% for tag in blog.all_tags %}
<option value="{{ blog.url }}/tagged/{{ tag | handleize }}" {% if current_tags contains tag %}selected{% endif %}>{{ tag }}</option>
{% endfor %}
</select>
{% include 'icon-chevron-down' %}
</div>
</div>
{% endif %}
</header>
</div>
{% if section.settings.layout == 'grid' %}
<div class="page-width">
<ul class="grid grid--uniform grid--blog">
{% for article in blog.articles %}
<li class="grid__item medium-up--one-third">
<a href="{{ article.url }}" class="article__link">
{% if article.image %}
{% capture img_id %}ArticleImage-{{ article.image.id }}{% endcapture %}
{% capture img_wrapper_id %}ArticleImageWrapper-{{ article.image.id }}{% endcapture %}
{%- assign img_url = article.image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
{% include 'image-style', image: article.image, height: 345, wrapper_id: img_wrapper_id, img_id: img_id %}
<div id="{{ img_wrapper_id }}" class="article__grid-image-wrapper js">
<div class="article__grid-image-container" style="padding-top:{{ 1 | divided_by: article.image.aspect_ratio | times: 100 }}%;" data-image-loading-animation>
<img id="{{ img_id }}"
class="article__grid-image lazyload"
data-src="{{ img_url }}"
data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048]"
data-aspectratio="{{ article.image.aspect_ratio }}"
data-sizes="auto"
alt="">
</div>
</div>
<noscript>
<div class="article__grid-image-wrapper">
{{ article | img_url: '345x345', scale: 2 | img_tag: article.title, 'article__grid-image' }}
</div>
</noscript>
{% endif %}
<h2 class="article__title h3{% if article.image %} article__title--has-image{% endif %}">
{{ article.title | escape }}
</h2>
</a>
<div class="article__grid-meta{% if article.image %} article__grid-meta--has-image{% endif %}">
{% if section.settings.blog_show_author %}
<span class="article__author">{{ 'blogs.article.by_author' | t: author: article.author }}</span>
{% endif %}
{% if section.settings.blog_show_date %}
<span class="article__date">
{{ article.published_at | time_tag: format: 'date' }}
</span>
{% endif %}
<div class="rte article__grid-excerpt">
{% if article.excerpt.size > 0 %}
{{ article.excerpt }}
{% else %}
{{ article.content | strip_html | truncate: 150 }}
{% endif %}
</div>
{% if article.tags.size > 0 %}
<div class="article__tags rte">
<ul class="list--inline" aria-label="{{ 'blogs.article.tags' | t }}">
{% for tag in article.tags %}
<li>
<a href="{{ blog.url }}/tagged/{{ tag | handle }}" class="article__grid-tag">{{ tag }}</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
<ul class="list--inline article__meta-buttons">
<li>
<a href="{{ article.url }}" class="btn btn--tertiary btn--small" aria-label="{{ 'blogs.article.read_more_title' | t: title: article.title }}">
{{ 'blogs.article.read_more' | t }}
</a>
</li>
{% if blog.comments_enabled? and article.comments_count > 0 %}
<li>
<a href="{{ article.url }}#comments" class="article__comment-count btn btn--tertiary btn--small">
{{ 'blogs.comments.comments_with_count' | t: count: article.comments_count }}
</a>
</li>
{% endif %}
</ul>
</div>
</li>
{% endfor %}
</ul>
</div>
{% else %}
<ul class="blog-list-view">
{% for article in blog.articles %}
<li class="border-top">
<div class="page-width">
<div class="grid">
<div class="grid__item medium-up--five-sixths medium-up--push-one-twelfth">
<div class="article-listing">
<h2 class="article__title h3"><a href="{{ article.url }}">{{ article.title }}</a></h2>
{% if section.settings.blog_show_author %}
<span class="article__author">{{ 'blogs.article.by_author' | t: author: article.author }}</span>
{% endif %}
{% if section.settings.blog_show_date %}
<span class="article__date">
{{ article.published_at | time_tag: format: 'date' }}
</span>
{% endif %}
{% if article.image %}
{% capture img_id %}ArticleImage-{{ article.image.id }}{% endcapture %}
{% capture img_wrapper_id %}ArticleImageWrapper-{{ article.image.id }}{% endcapture %}
{%- assign img_url = article.image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
{% include 'image-style', image: article.image, height: 600, wrapper_id: img_wrapper_id, img_id: img_id %}
<div id="{{ img_wrapper_id }}" class="article__list-image-wrapper js">
<a href="{{ article.url }}" style="padding-top:{{ 1 | divided_by: article.image.aspect_ratio | times: 100 }}%;" class="article__list-image-container" data-image-loading-animation>
<img id="{{ img_id }}"
class="article__list-image lazyload"
data-src="{{ img_url }}"
data-widths="[180, 360, 540, 720, 905, 1090, 1296, 1512, 1728, 2048]"
data-aspectratio="{{ article.image.aspect_ratio }}"
data-sizes="auto"
alt="">
</a>
</div>
<noscript>
<p>
<a href="{{ article.url }}">
{{ article | img_url: '455x300', scale: 2 | img_tag: article.title }}
</a>
</p>
</noscript>
{% endif %}
<div class="rte">
{% if article.excerpt.size > 0 %}
{{ article.excerpt }}
{% else %}
{{ article.content | strip_html | truncate: 150 }}
{% endif %}
</div>
{% if article.tags.size > 0 %}
<div class="article__tags article__tags--list rte">
{{ 'blogs.article.posted_in' | t }}
{% for tag in article.tags %}
<a href="{{ blog.url }}/tagged/{{ tag | handle }}">{{ tag }}</a>{% unless forloop.last %}, {% endunless %}
{% endfor %}
</div>
{% endif %}
<ul class="list--inline article__meta-buttons">
<li>
<a href="{{ article.url }}" class="btn btn--tertiary btn--small" aria-label="{{ 'blogs.article.read_more_title' | t: title: article.title }}">
{{ 'blogs.article.read_more' | t }}
</a>
</li>
{% if blog.comments_enabled? and article.comments_count > 0 %}
<li>
<a href="{{ article.url }}#comments" class="article__comment-count btn btn--tertiary btn--small">
{{ 'blogs.comments.comments_with_count' | t: count: article.comments_count }}
</a>
</li>
{% endif %}
</ul>
</div>
</div>
</div>
</div>
</li>
{% endfor %}
</ul>
{% endif %}
{%- if paginate.pages > 1 -%}
{% include 'pagination', paginate: paginate %}
{%- endif -%}
{% endpaginate %}
{% schema %}
{
"name": {
"cs": "Stránky blogu",
"da": "Blogsider",
"de": "Blogseiten",
"en": "Blog pages",
"es": "Páginas del blog",
"fi": "Blogisivut",
"fr": "Pages du blog",
"it": "Pagine del blog",
"ja": "ブログページ",
"ko": "블로그 페이지",
"nb": "Bloggsider",
"nl": "Blogpagina's",
"pl": "Strony blogu",
"pt-BR": "Páginas do blog",
"pt-PT": "Páginas do blogue",
"sv": "Bloggsidor",
"th": "หน้าบล็อก",
"tr": "Blog sayfaları",
"vi": "Trang blog",
"zh-CN": "博客页面",
"zh-TW": "部落格頁面"
},
"settings": [
{
"type": "select",
"id": "layout",
"label": {
"cs": "Rozvržení",
"da": "Layout",
"de": "Layout",
"en": "Layout",
"es": "Diseño",
"fi": "Asettelu",
"fr": "Mise en page",
"it": "Layout",
"ja": "レイアウト",
"ko": "레이아웃",
"nb": "Oppsett",
"nl": "Opmaak",
"pl": "Układ",
"pt-BR": "Layout",
"pt-PT": "Esquema",
"sv": "Layout",
"th": "เลย์เอาต์",
"tr": "Düzen",
"vi": "Bố cục",
"zh-CN": "布局",
"zh-TW": "版面配置"
},
"default": "list",
"options": [
{
"value": "grid",
"label": {
"cs": "Mřížka",
"da": "Gitter",
"de": "Raster",
"en": "Grid",
"es": "Cuadrícula",
"fi": "Ruudukko",
"fr": "Grille",
"it": "Griglia",
"ja": "グリッド",
"ko": "그리드",
"nb": "Rutenett",
"nl": "Raster",
"pl": "Siatka",
"pt-BR": "Grade",
"pt-PT": "Grelha",
"sv": "Rutnät",
"th": "กริด",
"tr": "Izgara",
"vi": "Lưới",
"zh-CN": "网格",
"zh-TW": "網格"
}
},
{
"value": "list",
"label": {
"cs": "Seznam",
"da": "Liste",
"de": "Liste",
"en": "List",
"es": "Lista",
"fi": "Luettelo",
"fr": "Liste",
"it": "Elenco",
"ja": "リスト",
"ko": "목록",
"nb": "Liste",
"nl": "Lijst",
"pl": "Lista",
"pt-BR": "Lista",
"pt-PT": "Lista",
"sv": "Lista",
"th": "รายการ",
"tr": "Liste",
"vi": "Danh sách",
"zh-CN": "列表",
"zh-TW": "清單"
}
}
]
},
{
"type": "checkbox",
"id": "blog_show_author",
"label": {
"cs": "Zobrazit autora",
"da": "Vis forfatter",
"de": "Autor anzeigen",
"en": "Show author",
"es": "Mostrar autor",
"fi": "Näytä tekijä",
"fr": "Afficher l'auteur",
"it": "Mostra autore",
"ja": "執筆者を表示する",
"ko": "작성자 표시",
"nb": "Vis forfatter",
"nl": "Auteur weergeven",
"pl": "Pokaż autora",
"pt-BR": "Exibir autor",
"pt-PT": "Mostrar autor",
"sv": "Visa författare",
"th": "แสดงผู้เขียน",
"tr": "Yazarı göster",
"vi": "Hiển thị tác giả",
"zh-CN": "显示作者",
"zh-TW": "顯示作者"
},
"default": true
},
{
"type": "checkbox",
"id": "blog_show_date",
"label": {
"cs": "Zobrazit datum",
"da": "Vis dato",
"de": "Datum anzeigen",
"en": "Show date",
"es": "Mostrar fecha",
"fi": "Näytä päivämäärä",
"fr": "Afficher la date",
"it": "Mostra data",
"ja": "日付を表示する",
"ko": "날짜 표시",
"nb": "Vis dato",
"nl": "Datum weergeven",
"pl": "Pokaż datę",
"pt-BR": "Exibir data",
"pt-PT": "Mostrar data",
"sv": "Visa datum",
"th": "แสดงวันที่",
"tr": "Tarihi göster",
"vi": "Hiển thị ngày",
"zh-CN": "显示日期",
"zh-TW": "顯示日期"
},
"default": true
}
]
}
{% endschema %}