-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathimage.html
45 lines (45 loc) · 2.16 KB
/
image.html
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
{% comment %}
Pouziti: `include image.html [img={string}] src={string} [href={string}] alt={string} title={string} [caption={string|markdown}] [attributes={string}]`
- `img`: Stejně jako u `code.html` umožňuje zadání obrázku pomocí markdown zápisu `![]()`.
- `src`, `href`: jsou cesty k obrazku (obrazkum nahled/plny)
- `alt`: popis obsahu obrazku
- `title`: titulek obrazku
- `caption`: popisek (jeden paragraf)
- `attributes`: HTML atributy pro `<img>` (primárně výška/šířka). Pokud nedefinováno, pokusí se získat ze `src`.
{% endcomment
%}{% if include.img
%}{% assign image= include.img | strip | replace: ""
%}{% assign relative_url= src | first
%}{% if relative_url == "\/"
%}{% assign src= src | prepend: site.baseurl
%}{% assign href= href | prepend: site.baseurl
%}{% endif
%}<figure class="C__figureObject">
<a href="{{ href }}" title="{{ title }}" target="_blank">
<img src="{{ src }}" alt="{{ alt }}" class="maxH__image" loading="lazy"{{attributes}}/>
</a>{%
if include.caption %}
<figcaption class="info">{{ include.caption | markdownify }}</figcaption>{%
endif %}
</figure>