aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJieiku2023-08-15 21:10:25 -0700
committerJieiku2023-08-15 21:10:25 -0700
commit0983915e23793c28dd0bee149fd2ec05a7e96a94 (patch)
tree0f7c8c7c97e33e4a0e4c1c2e1150f94fdc2ba022 /templates
parent729f7cda12340aabce5d0faab8d306b5e0d59568 (diff)
downloadabridge-0983915e23793c28dd0bee149fd2ec05a7e96a94.tar.gz
abridge-0983915e23793c28dd0bee149fd2ec05a7e96a94.tar.bz2
abridge-0983915e23793c28dd0bee149fd2ec05a7e96a94.zip
Lighthouse and YellowLabTools optimizations
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html2
-rw-r--r--templates/macros/social.html4
-rw-r--r--templates/shortcodes/image.html2
-rw-r--r--templates/shortcodes/img.html7
-rw-r--r--templates/shortcodes/imgswap.html14
5 files changed, 19 insertions, 10 deletions
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) }}
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
{{- macros_head::stylesheets_preload(config=config) }}
{{- macros_head::js(config=config) }}
<meta name="base" content="{{ config.base_url | safe }}" />
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) %}
- <nav>
+ <nav><div>
{%- if config.generate_feed and config.extra.feed -%}
<a href="{{ get_url(path=config.feed_filename, trailing_slash=false, lang=lang) | safe }}" target="_blank" title="Atom/RSS Feed"><i type="Button" class="svg rss" title="Atom/RSS Feed"></i></a>{% endif -%}
{%- if config.extra.mail -%}
@@ -54,5 +54,5 @@
<a href="https://www.buymeacoffee.com/{{ config.extra.buymeacoffee }}/" target="_blank" title="Buy Me A Coffee"><i type="Button" class="svg buymeacoffee" title="Buy Me A Coffee"></i></a>{% endif -%}
{%- if config.extra.github_sponsor -%}
<a href="https://github.com/sponsors/{{ config.extra.github_sponsor }}/" target="_blank" title="GitHub Sponsor"><i type="Button" class="svg github-sponsor" title="GitHub Sponsor"></i></a>{% endif -%}
- </nav>
+ </div></nav>
{%- 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 -%}
<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>