From b9b76799ebdcc08fcdd66099f2ba4e76c32cc07f Mon Sep 17 00:00:00 2001 From: Olexandr88 Date: Mon, 14 Apr 2025 20:03:16 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=93=9D=20misc(README):=20fix=20broken?= =?UTF-8?q?=20link=20tag=20(#516)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a84cbb2..ceec3e2 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Contributors Forks - + Last commit
From 221e245671751e978a9e1f1b11829ef1554eaf2a Mon Sep 17 00:00:00 2001 From: Gabriel Martinez Date: Sat, 26 Apr 2025 02:18:36 -0700 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=8D=B1=20feat(socials):=20add=20itch.?= =?UTF-8?q?io=20icon=20(#520)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/social_icons/itchio.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 static/social_icons/itchio.svg diff --git a/static/social_icons/itchio.svg b/static/social_icons/itchio.svg new file mode 100644 index 0000000..4a4ac25 --- /dev/null +++ b/static/social_icons/itchio.svg @@ -0,0 +1 @@ + \ No newline at end of file From f47cefd42bf5fe4b39b21be0f95bac62e5772f6b Mon Sep 17 00:00:00 2001 From: tzinm Date: Sat, 26 Apr 2025 11:21:09 +0200 Subject: [PATCH 3/3] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20add=20"tar?= =?UTF-8?q?get=5Fattribute"=20macro=20(#515)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Óscar --- templates/base.html | 1 + templates/macros/target_attribute.html | 11 +++++++++++ templates/page.html | 6 +----- templates/partials/cards_pages.html | 6 +----- templates/partials/footer.html | 6 +----- 5 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 templates/macros/target_attribute.html diff --git a/templates/base.html b/templates/base.html index d3d0cc1..6933a48 100644 --- a/templates/base.html +++ b/templates/base.html @@ -6,6 +6,7 @@ {% import "macros/table_of_contents.html" as macros_toc %} {% import "macros/translate.html" as macros_translate %} {% import "macros/series_page.html" as macros_series_page %} +{% import "macros/target_attribute.html" as macros_target_attribute %} {# Load the internationalisation data for the current language from the .toml files in the user's '/i18n' folder, falling back to the theme's. diff --git a/templates/macros/target_attribute.html b/templates/macros/target_attribute.html new file mode 100644 index 0000000..2da5b9d --- /dev/null +++ b/templates/macros/target_attribute.html @@ -0,0 +1,11 @@ +{% macro target_attribute(new_tab) %} + +{%- set blank_target = "" -%} + +{%- if new_tab -%} + {%- set blank_target = "target=_blank" -%} +{%- endif -%} + +{{ blank_target }} + +{% endmacro target_attribute %} diff --git a/templates/page.html b/templates/page.html index 7099297..8ed6816 100644 --- a/templates/page.html +++ b/templates/page.html @@ -5,11 +5,7 @@ {%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%} -{%- if config.markdown.external_links_target_blank -%} - {%- set blank_target = "target=_blank" -%} -{%- else -%} - {%- set blank_target = "" -%} -{%- endif -%} +{%- set blank_target = macros_target_attribute::target_attribute(new_tab=config.markdown.external_links_target_blank) -%} {# Debugging #} {#
diff --git a/templates/partials/cards_pages.html b/templates/partials/cards_pages.html
index 0486829..89bdabc 100644
--- a/templates/partials/cards_pages.html
+++ b/templates/partials/cards_pages.html
@@ -7,11 +7,7 @@
             {% break %}
         {% endif %}
         {# Determine which URL to use, default is page.permalink #}
-        {%- if page.extra.link_to and config.markdown.external_links_target_blank -%}
-            {%- set blank_target = "target=_blank" -%}
-        {%- else -%}
-            {%- set blank_target = "" -%}
-        {%- endif -%}
+        {%- set blank_target = macros_target_attribute::target_attribute(new_tab=config.markdown.external_links_target_blank and page.extra.link_to) -%}
 
         {% set target_url = page.extra.link_to | default(value=page.permalink) %}
 
diff --git a/templates/partials/footer.html b/templates/partials/footer.html
index 9d89e1d..9e984ed 100644
--- a/templates/partials/footer.html
+++ b/templates/partials/footer.html
@@ -2,11 +2,7 @@
 
 {%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%}
 
-{%- if config.markdown.external_links_target_blank -%}
-    {%- set blank_target = "target=_blank" -%}
-{%- else -%}
-    {%- set blank_target = "" -%}
-{%- endif -%}
+{%- set blank_target = macros_target_attribute::target_attribute(new_tab=config.markdown.external_links_target_blank) -%}
 
 {#- Feed icon -#}
 {#- Zola 0.19.0 uses `generate_feeds`. Prior versions use `generate_feed` -#}