diff options
| author | Alejandro Soto <alejandro@34project.org> | 2025-09-13 14:55:15 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2025-09-13 14:55:15 -0600 |
| commit | 87f85704af1fa866be83077b2b351c1fdad7c3ce (patch) | |
| tree | b49c8d49ef717e539bff6578992e692eea55d380 /themes/tabi-lean/templates/macros/rel_attributes.html | |
| parent | 1a4c3216f027d6a6f36104547377b7b21faa5015 (diff) | |
| parent | a2ea06d513a5802964f8f0ef5795cec7e548ed7b (diff) | |
Merge commit 'a2ea06d513a5802964f8f0ef5795cec7e548ed7b' as 'themes/tabi-lean'
Diffstat (limited to 'themes/tabi-lean/templates/macros/rel_attributes.html')
| -rw-r--r-- | themes/tabi-lean/templates/macros/rel_attributes.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/themes/tabi-lean/templates/macros/rel_attributes.html b/themes/tabi-lean/templates/macros/rel_attributes.html new file mode 100644 index 0000000..71672c7 --- /dev/null +++ b/themes/tabi-lean/templates/macros/rel_attributes.html @@ -0,0 +1,19 @@ +{% 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 %} |
