Skip to content

Commit 14cecc2

Browse files
authored
Merge pull request #3 from qiyan98/master
Update FVMD blogs
2 parents a686384 + 0875495 commit 14cecc2

33 files changed

+1002
-11
lines changed

_includes/figure.liquid

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{% assign img_path = include.path | remove: '.jpg' | remove: '.jpeg' | remove: '.png' | remove: '.tiff' | remove: '.gif' %}
2+
3+
<figure
4+
{% if include.slot %}
5+
slot="{{ include.slot }}"
6+
{% endif %}
7+
>
8+
<picture>
9+
<!-- Auto scaling with imagemagick -->
10+
<!--
11+
See https://www.debugbear.com/blog/responsive-images#w-descriptors-and-the-sizes-attribute and
12+
https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images for info on defining 'sizes' for responsive images
13+
-->
14+
{% if site.imagemagick.enabled %}
15+
<source
16+
class="responsive-img-srcset"
17+
srcset="{% for i in site.imagemagick.widths %}{{ img_path | relative_url }}-{{ i }}.webp {{i}}w,{% endfor %}"
18+
{% if include.sizes %}
19+
sizes="{{include.sizes}}"
20+
{% else %}
21+
sizes="95vw"
22+
{% endif %}
23+
type="image/webp"
24+
>
25+
{% endif %}
26+
<img
27+
src="{% if include.cache_bust %}{{ include.path | relative_url | bust_file_cache }}{% else %}{{ include.path | relative_url }}{% endif %}"
28+
{% if include.class %}
29+
class="{{ include.class }}"
30+
{% endif %}
31+
{% if include.width %}
32+
width="{{ include.width }}"
33+
{% else %}
34+
width="100%"
35+
{% endif %}
36+
{% if include.height %}
37+
height="{{ include.height }}"
38+
{% else %}
39+
height="auto"
40+
{% endif %}
41+
{% if include['min-width'] or include['min-height'] or include['max-width'] or include['max-height'] %}
42+
style="
43+
{% if include['min-width'] %}
44+
min-width: {{ include.min-width }};
45+
{% endif %}
46+
{% if include['min-height'] %}
47+
min-height: {{ include.min-height }};
48+
{% endif %}
49+
{% if include['max-width'] %}
50+
max-width: {{ include.max-width }};
51+
{% endif %}
52+
{% if include['max-height'] %}
53+
max-height: {{ include.max-height }};
54+
{% endif %}
55+
"
56+
{% endif %}
57+
{% if include.alt %}
58+
alt="{{ include.alt }}"
59+
{% endif %}
60+
{% if include.title %}
61+
title="{{ include.title }}"
62+
{% endif %}
63+
{% if include.zoomable %}
64+
data-zoomable
65+
{% endif %}
66+
{% if include.loading %}
67+
loading="{{ include.loading }}"
68+
{% elsif site.lazy_loading_images %}
69+
loading="lazy"
70+
{% endif %}
71+
onerror="this.onerror=null; $('.responsive-img-srcset').remove();"
72+
>
73+
</picture>
74+
75+
{% if include.caption %}
76+
<figcaption class="caption">{{ include.caption }}</figcaption>
77+
{% endif %}
78+
</figure>

_includes/video.liquid

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{% assign extension = include.path | split: '.' | last %}
2+
3+
<figure>
4+
{% if extension == 'mp4' or extension == 'webm' or extension == 'ogg' %}
5+
<video
6+
src="{% if include.cache_bust %}{{ include.path | relative_url | bust_file_cache }}{% else %}{{ include.path | relative_url }}{% endif %}"
7+
{% if include.class %}
8+
class="{{ include.class }}"
9+
{% endif %}
10+
{% if include.width %}
11+
width="{{ include.width }}"
12+
{% else %}
13+
width="auto"
14+
{% endif %}
15+
{% if include.height %}
16+
height="{{ include.height }}"
17+
{% else %}
18+
height="auto"
19+
{% endif %}
20+
{% if include['min-width'] %}
21+
min-width="{{ include.min-width }}"
22+
{% endif %}
23+
{% if include['min-height'] %}
24+
min-height="{{ include.min-height }}"
25+
{% endif %}
26+
{% if include['max-width'] %}
27+
max-width="{{ include.max-width }}"
28+
{% endif %}
29+
{% if include['max-height'] %}
30+
height="{{ include.max-height }}"
31+
{% endif %}
32+
{% if include.title %}
33+
title="{{ include.title }}"
34+
{% endif %}
35+
{% if include.alt %}
36+
alt="{{ include.alt }}"
37+
{% endif %}
38+
{% if include.autoplay %}
39+
autoplay
40+
{% endif %}
41+
{% if include.controls %}
42+
controls
43+
{% endif %}
44+
{% if include.loop %}
45+
loop
46+
{% endif %}
47+
{% if include.muted %}
48+
muted
49+
{% endif %}
50+
{% if include.poster %}
51+
poster="{{ include.poster }}"
52+
{% endif %}
53+
/>
54+
55+
{% else %}
56+
<iframe
57+
src="{{ include.path }}"
58+
{% if include.class %}
59+
class="{{ include.class }}"
60+
{% endif %}
61+
frameborder="0"
62+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
63+
allowfullscreen
64+
{% if include.width %}
65+
width="{{ include.width }}"
66+
{% else %}
67+
width="auto"
68+
{% endif %}
69+
{% if include.height %}
70+
height="{{ include.height }}"
71+
{% else %}
72+
height="auto"
73+
{% endif %}
74+
{% if include['min-width'] %}
75+
min-width="{{ include.min-width }}"
76+
{% endif %}
77+
{% if include['min-height'] %}
78+
min-height="{{ include.min-height }}"
79+
{% endif %}
80+
{% if include['max-width'] %}
81+
max-width="{{ include.max-width }}"
82+
{% endif %}
83+
{% if include['max-height'] %}
84+
height="{{ include.max-height }}"
85+
{% endif %}
86+
{% if include.alt %}
87+
alt="{{ include.alt }}"
88+
{% endif %}
89+
{% if include.title %}
90+
title="{{ include.title }}"
91+
{% endif %}
92+
/>
93+
{% endif %}
94+
{% if include.caption %}
95+
<figcaption class="caption">{{ include.caption }}</figcaption>
96+
{% endif %}
97+
</figure>

_posts/2023-07-18-custom-blockquotes.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)