aboutsummaryrefslogtreecommitdiff
path: root/templates/shortcodes
diff options
context:
space:
mode:
Diffstat (limited to 'templates/shortcodes')
-rw-r--r--templates/shortcodes/image.html2
-rw-r--r--templates/shortcodes/img.html7
-rw-r--r--templates/shortcodes/imgswap.html14
-rw-r--r--templates/shortcodes/streamable.html3
-rw-r--r--templates/shortcodes/vimeo.html3
-rw-r--r--templates/shortcodes/vm.html3
-rw-r--r--templates/shortcodes/youtube.html3
-rw-r--r--templates/shortcodes/yt.html3
8 files changed, 25 insertions, 13 deletions
diff --git a/templates/shortcodes/image.html b/templates/shortcodes/image.html
index 8452ce9..4f9d3de 100644
--- a/templates/shortcodes/image.html
+++ b/templates/shortcodes/image.html
@@ -3,5 +3,5 @@
{% set type = source | split(pat=".") | last -%}
<source srcset="{{ config.base_url | safe}}{{ page.path | safe }}{{ source | safe }}" type="{{ 'img/' ~ type }}" />
{% endfor -%}
- <img src="{{ fpath }}" alt="{{ falt | default(value='Image') }}"{% if fw %} width="{{fw}}"{% endif %}{% if fh %} height="{{fh}}"{% endif %} />
+ <img src="{{ fpath }}" alt="{{ falt | default(value='Image') }}"{% if fw %} width="{{fw}}"{% endif %}{% if fh %} height="{{fh}}"{% endif %} loading="lazy" />
</picture>
diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html
index cf2a562..f23f783 100644
--- a/templates/shortcodes/img.html
+++ b/templates/shortcodes/img.html
@@ -24,5 +24,8 @@
{%- endif %}
{%- set img = src | split(pat="/") | last %}
-{%- set name = img | split(pat=".") | first %}
-<img src="{{ path | safe }}{{ img | safe }}"{% if class %} class="{{class}}"{% endif %}{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} />
+
+{%- if not alt %}
+ {%- set alt = img | split(pat=".") | first %}
+{%- endif %}
+<img src="{{ path | safe }}{{ img | safe }}"{% if class %} class="{{class}}"{% endif %}{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" />
diff --git a/templates/shortcodes/imgswap.html b/templates/shortcodes/imgswap.html
index f8c983c..4397b29 100644
--- a/templates/shortcodes/imgswap.html
+++ b/templates/shortcodes/imgswap.html
@@ -25,8 +25,11 @@
{%- endif %}
{%- set img = main_src | split(pat="/") | last %}
- {%- set name = img | split(pat=".") | first %}
- <img src="{{ path | safe }}{{ img | safe }}" class="img-main{% if class %} {{class}}{% endif %}"{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} />
+
+ {%- if not alt %}
+ {%- set alt = img | split(pat=".") | first %}
+ {%- endif %}
+ <img src="{{ path | safe }}{{ img | safe }}" class="img-main{% if class %} {{class}}{% endif %}"{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" />
{%- set dirtest = swap_src | trim_start_matches(pat="./") %}
{%- if dirtest is containing("/") %}
@@ -54,6 +57,9 @@
{%- endif %}
{%- set img = swap_src | split(pat="/") | last %}
- {%- set name = img | split(pat=".") | first %}
- <img src="{{ path | safe }}{{ img | safe }}" class="img-swap{% if class %} {{class}}{% endif %}"{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} />
+
+ {%- if not alt %}
+ {%- set alt = img | split(pat=".") | first %}
+ {%- endif %}
+ <img src="{{ path | safe }}{{ img | safe }}" class="img-swap{% if class %} {{class}}{% endif %}"{% if alt %} alt="{{alt}}"{% endif %}{% if w %} width="{{w}}"{% endif %}{% if h %} height="{{h}}"{% endif %} loading="lazy" />
</div>
diff --git a/templates/shortcodes/streamable.html b/templates/shortcodes/streamable.html
new file mode 100644
index 0000000..7df8e9e
--- /dev/null
+++ b/templates/shortcodes/streamable.html
@@ -0,0 +1,3 @@
+<div class="yv{% if class %} {{class}}{% endif %}">
+ <iframe src="https://www.streamable.com/e/{{id}}" title="{{title | default(value='Streamable') }}" class="yvi" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
+</div>
diff --git a/templates/shortcodes/vimeo.html b/templates/shortcodes/vimeo.html
new file mode 100644
index 0000000..0fe3129
--- /dev/null
+++ b/templates/shortcodes/vimeo.html
@@ -0,0 +1,3 @@
+<div class="yv{% if class %} {{class}}{% endif %}">
+ <iframe src="https://player.vimeo.com/video/{{id}}?embedded=true{% if autoplay %}&autoplay=1{% endif %}{% if loop %}&loop=1{% endif %}{% if noautopause %}&autopause=0{% endif %}{% if not cookie %}&dnt=1{% endif %}" title="{{title | default(value='Vimeo') }}" class="yvi" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
+</div>
diff --git a/templates/shortcodes/vm.html b/templates/shortcodes/vm.html
deleted file mode 100644
index 2dd60e8..0000000
--- a/templates/shortcodes/vm.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<div class="yv{% if class %} {{class}}{% endif %}">
- <iframe src="https://player.vimeo.com/video/{{id}}?embedded=true{% if autoplay %}&autoplay=1{% endif %}{% if loop %}&loop=1{% endif %}{% if noautopause %}&autopause=0{% endif %}{% if not cookie %}&dnt=1{% endif %}" title="{{title | default(value='Vimeo') }}" class="yvi" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
-</div>
diff --git a/templates/shortcodes/youtube.html b/templates/shortcodes/youtube.html
new file mode 100644
index 0000000..d07b91b
--- /dev/null
+++ b/templates/shortcodes/youtube.html
@@ -0,0 +1,3 @@
+<div class="yv{% if class %} {{class}}{% endif %}">
+ <iframe src="https://www.youtube{% if not cookie %}-nocookie{% endif %}.com/embed/{{id}}{% if playlist %}?list={{playlist}}{% endif %}{% if autoplay %}?autoplay=1{% endif %}" title="{{title | default(value='Youtube') }}" class="yvi" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
+</div>
diff --git a/templates/shortcodes/yt.html b/templates/shortcodes/yt.html
deleted file mode 100644
index 9fb99dd..0000000
--- a/templates/shortcodes/yt.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<div class="yv{% if class %} {{class}}{% endif %}">
- <iframe src="https://www.youtube{% if not cookie %}-nocookie{% endif %}.com/embed/{{id}}{% if playlist %}?list={{playlist}}{% endif %}{% if autoplay %}?autoplay=1{% endif %}" title="{{title | default(value='Youtube') }}" class="yvi" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
-</div>