File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change
1
+ {% comment %}
2
+ TRUE VERSUS "TRUE"
3
+ Some attributes can be set by passing the string "true" into this template.
4
+ For example, the thumbnail attribute. That is why some comparisons use the
5
+ language builtin true and others compare to the string "true".
6
+ {% endcomment %}
7
+
1
8
{%- assign img-style = false -%}
9
+ {%- assign img-link = false -%}
2
10
3
11
{%- if include.width or include.height -%}
4
12
{%- assign img-style = true -%}
5
13
{%- endif -%}
6
14
15
+ {%- if include.link -%}
16
+ {%- assign img-link = include.link -%}
17
+ {%- elseif include.thumbnail == "true" -%}
18
+ {%- capture img-link -%}{{ site.baseurl }}/{{ include.url }}{%- endcapture -%}
19
+ {%- endif -%}
20
+ {% comment %}
21
+ If the link parameter is used, the URL will be set to its contents. If the
22
+ thumbnail parameter has been used, the URL will automatically be set to the original
23
+ image. Otherwise, no link will be generated for the image.
24
+ {% endcomment %}
25
+
7
26
{% if include.caption %}
8
27
< figure class ="caption-image {% if include.thumbnail == "true " %} thumbnail{%- endif -%}">
9
28
{%- endif -%}
10
- {%- if include.link -%}
11
- < a href ="{{- include.link -}} ">
12
- {%- elsif include.thumbnail == "true" -%}
13
- < a href ="{{ site.baseurl }}/{{ include.url }} ">
29
+ {%- if img-link -%}
30
+ < a href ="{{- img-link -}} ">
14
31
{%- endif -%}
15
32
< img
16
33
src ="{{ site.baseurl }}/{{ include.url }} "
20
37
style ="{%- if include.width -%}width: {{- include.width -}};{%- endif -%}{%- if include.height -%}height: {{- include.height -}};{%- endif -%} "
21
38
{% endif -%}
22
39
>
23
- {%- if include. link or include.thumbnail -%}
40
+ {%- if img- link -%}
24
41
</ a >
25
42
{%- endif -%}
26
43
{% if include.caption %}
You can’t perform that action at this time.
0 commit comments