homepage/templates/macros/rel_attributes.html
Fabian Montero 14822297bd Squashed 'themes/tabi-lean/' content from commit 95c8796
git-subtree-dir: themes/tabi-lean
git-subtree-split: 95c879696445ede40daa7a30a88dae5dd74d5c0c
2025-09-13 14:21:22 -06:00

19 lines
803 B
HTML

{% macro rel_attributes() %}
{%- set rel_attributes = [] -%}
{%- if config.markdown.external_links_target_blank -%}
{%- set rel_attributes = rel_attributes | concat(with="noopener") -%}
{%- endif -%}
{# https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel#nofollow #}
{# This is ignored, as it doesn't make sense to set `nofollow` on projects or social links. #}
{# {%- if config.markdown.external_links_no_follow -%}
{%- set rel_attributes = rel_attributes | concat(with="nofollow") -%}
{%- endif -%} #}
{%- if config.markdown.external_links_no_referrer -%}
{%- set rel_attributes = rel_attributes | concat(with="noreferrer") -%}
{%- endif -%}
{# Return the array of rel attributes joined by a space #}
{{- rel_attributes | join(sep=" ") -}}
{% endmacro rel_attributes %}