From 0983915e23793c28dd0bee149fd2ec05a7e96a94 Mon Sep 17 00:00:00 2001
From: Jieiku
Date: Tue, 15 Aug 2023 21:10:25 -0700
Subject: Lighthouse and YellowLabTools optimizations
---
templates/shortcodes/imgswap.html | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
(limited to 'templates/shortcodes/imgswap.html')
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 %}
-
+
+ {%- if not alt %}
+ {%- set alt = img | split(pat=".") | first %}
+ {%- endif %}
+
{%- 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 %}
-
+
+ {%- if not alt %}
+ {%- set alt = img | split(pat=".") | first %}
+ {%- endif %}
+
--
cgit v1.3.1