From ebcd9063003972c73acb379a2cae30c4cff8c5a6 Mon Sep 17 00:00:00 2001 From: Gordon Stanton Date: Sat, 11 Mar 2023 01:57:51 +1100 Subject: [PATCH 1/8] Moved thumbnail image tag to Block with conditional lazy load. --- templates/content-correspondents.tpl.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/content-correspondents.tpl.html b/templates/content-correspondents.tpl.html index 25847d2..585eeae 100644 --- a/templates/content-correspondents.tpl.html +++ b/templates/content-correspondents.tpl.html @@ -4,6 +4,7 @@

For more information on how to become a Correspondent see our contribute page. To add a logo here, either email one to admin at hpr or setup your email on Gravatar. To protect your browsing privacy we gather the images every hour and serve them directly from HPR.

+ @@ -17,15 +18,19 @@ on h.hostid = e.hostid ' ) %--> - + - +
Avatar Name & Host ID
avatar
Host ID:

Become a Correspondent

+ + +avatar of <!--% host_name | html %--> 9 %-->loading="lazy" /> + From ce4aefe8288c0dddf9137521dcc8f4033431e0e6 Mon Sep 17 00:00:00 2001 From: Gordon Stanton Date: Sun, 12 Mar 2023 18:48:51 +1100 Subject: [PATCH 2/8] Renamed macro get_avatar to get_avatar_src as per suggestion. Moved host_thumb macro into shared avatar template file. Made condition of lazy loading a parameter. --- templates/content-correspondent.tpl.html | 2 +- templates/content-correspondents.tpl.html | 6 +----- templates/content-episode.tpl.html | 4 ++-- templates/content-index.tpl.html | 5 ++--- templates/content-twat_episode.tpl.html | 4 ++-- templates/host-thumbnail.tpl.html | 3 --- templates/shared-avatar.tpl.html | 5 ++++- 7 files changed, 12 insertions(+), 17 deletions(-) delete mode 100644 templates/host-thumbnail.tpl.html diff --git a/templates/content-correspondent.tpl.html b/templates/content-correspondent.tpl.html index 2b677a2..ea5398c 100644 --- a/templates/content-correspondent.tpl.html +++ b/templates/content-correspondent.tpl.html @@ -55,7 +55,7 @@

Correspondent

-

Host Image
:


diff --git a/templates/content-correspondents.tpl.html b/templates/content-correspondents.tpl.html index 585eeae..b9bd96f 100644 --- a/templates/content-correspondents.tpl.html +++ b/templates/content-correspondents.tpl.html @@ -18,7 +18,7 @@ on h.hostid = e.hostid ' ) %--> - +
@@ -30,7 +30,3 @@

Become a Correspondent

- - -avatar of <!--% host_name | html %--> 9 %-->loading="lazy" /> - diff --git a/templates/content-episode.tpl.html b/templates/content-episode.tpl.html index b4d1040..2c6ec91 100644 --- a/templates/content-episode.tpl.html +++ b/templates/content-episode.tpl.html @@ -16,8 +16,8 @@

-

-
+

+
Hosted by on is flagged as and is released under a license.

| diff --git a/templates/content-index.tpl.html b/templates/content-index.tpl.html index 9116754..6de2665 100644 --- a/templates/content-index.tpl.html +++ b/templates/content-index.tpl.html @@ -1,5 +1,4 @@ - @@ -44,9 +43,9 @@

hpr ::

-

+

- +
Hosted by on is flagged as and released under a license.

diff --git a/templates/content-twat_episode.tpl.html b/templates/content-twat_episode.tpl.html index a408bea..0d7b65f 100644 --- a/templates/content-twat_episode.tpl.html +++ b/templates/content-twat_episode.tpl.html @@ -52,8 +52,8 @@

-

-
+

+
Hosted by on is flagged as and is released under a license.

diff --git a/templates/host-thumbnail.tpl.html b/templates/host-thumbnail.tpl.html deleted file mode 100644 index a7dda96..0000000 --- a/templates/host-thumbnail.tpl.html +++ /dev/null @@ -1,3 +0,0 @@ - -Thumbnail of <!--% host_name | html %-->loading="lazy" /> - diff --git a/templates/shared-avatar.tpl.html b/templates/shared-avatar.tpl.html index ffda253..c0e05db 100644 --- a/templates/shared-avatar.tpl.html +++ b/templates/shared-avatar.tpl.html @@ -1,5 +1,8 @@ - + hosts/ hpr_logo.png + +Thumbnail of <!--% host_name | html %--> min_cnt %-->loading="lazy" /> + From 5b4421071fc9fe1c69a95230f19e4c157532d01b Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Mon, 13 Mar 2023 23:03:15 -0400 Subject: [PATCH 3/8] Add MACRO lazy_load Macro which allows programatically setting the HTML5 img loading attribute. --- templates/shared-avatar.tpl.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/shared-avatar.tpl.html b/templates/shared-avatar.tpl.html index c0e05db..13354ee 100644 --- a/templates/shared-avatar.tpl.html +++ b/templates/shared-avatar.tpl.html @@ -1,3 +1,6 @@ + +loading="lazy" + hosts/ From dee924e6a8e29d354af60be36271b463ce752c13 Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Mon, 13 Mar 2023 23:10:36 -0400 Subject: [PATCH 4/8] Rename MACRO host_thumb to get_avatar Update to use lazy_load MACRO and minimize number of arguments needed. --- templates/content-correspondents.tpl.html | 4 ++-- templates/shared-avatar.tpl.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/content-correspondents.tpl.html b/templates/content-correspondents.tpl.html index b9bd96f..dce4335 100644 --- a/templates/content-correspondents.tpl.html +++ b/templates/content-correspondents.tpl.html @@ -1,9 +1,9 @@ +

Correspondents

For more information on how to become a Correspondent see our contribute page. To add a logo here, either email one to admin at hpr or setup your email on Gravatar. To protect your browsing privacy we gather the images every hour and serve them directly from HPR.

- @@ -18,7 +18,7 @@ on h.hostid = e.hostid ' ) %--> - +
Avatar

diff --git a/templates/shared-avatar.tpl.html b/templates/shared-avatar.tpl.html index 13354ee..f74c332 100644 --- a/templates/shared-avatar.tpl.html +++ b/templates/shared-avatar.tpl.html @@ -6,6 +6,6 @@ hosts/ hpr_logo.png - -Thumbnail of <!--% host_name | html %--> min_cnt %-->loading="lazy" /> + +Thumbnail of <!--% host_name | html %--> /> From 7a6ace156fafa1c0d367691a5934b62fb8656dbe Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Mon, 13 Mar 2023 23:13:25 -0400 Subject: [PATCH 5/8] Refactor template to use get_avatar MACRO --- templates/content-correspondent.tpl.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/content-correspondent.tpl.html b/templates/content-correspondent.tpl.html index ea5398c..afe67a6 100644 --- a/templates/content-correspondent.tpl.html +++ b/templates/content-correspondent.tpl.html @@ -55,8 +55,7 @@

Correspondent

-

Host Image
+


:


From 3a8b6db348e019775eb55e4c3f9773153f91a60c Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Mon, 13 Mar 2023 23:14:35 -0400 Subject: [PATCH 6/8] Add show_avatar MACRO --- templates/shared-avatar.tpl.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/shared-avatar.tpl.html b/templates/shared-avatar.tpl.html index f74c332..41f21d3 100644 --- a/templates/shared-avatar.tpl.html +++ b/templates/shared-avatar.tpl.html @@ -9,3 +9,8 @@ Thumbnail of <!--% host_name | html %--> /> + + +
+ + From aabeca44f50a9db05f379cc86725786e59ef6879 Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Mon, 13 Mar 2023 23:15:46 -0400 Subject: [PATCH 7/8] Refactor templates to use show_avatar MACRO --- templates/content-episode.tpl.html | 3 +-- templates/content-index.tpl.html | 7 ++----- templates/content-twat_episode.tpl.html | 3 +-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/templates/content-episode.tpl.html b/templates/content-episode.tpl.html index 2c6ec91..dc446f1 100644 --- a/templates/content-episode.tpl.html +++ b/templates/content-episode.tpl.html @@ -16,8 +16,7 @@

-

-
+

Hosted by on is flagged as and is released under a license.

| diff --git a/templates/content-index.tpl.html b/templates/content-index.tpl.html index 6de2665..7d7331e 100644 --- a/templates/content-index.tpl.html +++ b/templates/content-index.tpl.html @@ -43,11 +43,8 @@

hpr ::

-

- - - -
Hosted by on is flagged as and released under a license.
+

+ Hosted by on is flagged as and released under a license.

| diff --git a/templates/content-twat_episode.tpl.html b/templates/content-twat_episode.tpl.html index 0d7b65f..ae844d3 100644 --- a/templates/content-twat_episode.tpl.html +++ b/templates/content-twat_episode.tpl.html @@ -52,8 +52,7 @@

-

-
+

Hosted by on is flagged as and is released under a license.

From c9278c0dd61ba64a3b0ba084c659cc5e39aa6f1c Mon Sep 17 00:00:00 2001 From: Roan Horning Date: Mon, 13 Mar 2023 23:16:37 -0400 Subject: [PATCH 8/8] Remove unused PROCESS directive --- templates/content-comments_viewer.tpl.html | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/content-comments_viewer.tpl.html b/templates/content-comments_viewer.tpl.html index a715c7b..8e1253b 100644 --- a/templates/content-comments_viewer.tpl.html +++ b/templates/content-comments_viewer.tpl.html @@ -1,5 +1,4 @@ -