♻️ refactor: add "target_attribute" macro (#515)

Co-authored-by: Óscar <welpo@users.noreply.github.com>
This commit is contained in:
tzinm 2025-04-26 11:21:09 +02:00 committed by GitHub
parent 221e245671
commit f47cefd42b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 15 additions and 15 deletions

View file

@ -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) %}