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/base.html | 2 +- templates/macros/social.html | 4 ++-- templates/shortcodes/image.html | 2 +- templates/shortcodes/img.html | 7 +++++-- templates/shortcodes/imgswap.html | 14 ++++++++++---- 5 files changed, 19 insertions(+), 10 deletions(-) (limited to 'templates') diff --git a/templates/base.html b/templates/base.html index 2ab46f8..fd3c553 100644 --- a/templates/base.html +++ b/templates/base.html @@ -9,7 +9,7 @@ {{- macros_head::stylesheets(config=config) }} - + {{- macros_head::stylesheets_preload(config=config) }} {{- macros_head::js(config=config) }} diff --git a/templates/macros/social.html b/templates/macros/social.html index 6ad83de..1221ce7 100644 --- a/templates/macros/social.html +++ b/templates/macros/social.html @@ -1,5 +1,5 @@ {%- macro social_links(config) %} - + {%- if config.generate_feed and config.extra.feed -%} {% endif -%} {%- if config.extra.mail -%} @@ -54,5 +54,5 @@ {% endif -%} {%- if config.extra.github_sponsor -%} {% endif -%} - + {%- endmacro %} 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 -%} {% endfor -%} - + 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 %} - + +{%- if not alt %} + {%- set alt = img | split(pat=".") | first %} +{%- endif %} + 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