Files
2025-08-16 11:11:40 +02:00

28 lines
885 B
HTML

{#-
This file was automatically generated - do not edit
-#}
{% macro split_and_get(value, sep, index) %}
{%- if value.split is defined -%}
{%- set parts = value.split(sep) -%}
{%- else -%}
{%- set parts = value | split(sep) -%}
{%- endif -%}
{{- parts[index] -}}
{% endmacro %}
<div class="md-social">
{% for social in config.extra.social %}
{% set rel = "noopener" %}
{% if "mastodon" in social.icon %}
{% set rel = rel ~ " me" %}
{% endif %}
{% set title = social.name %}
{% if not title and "//" in social.link %}
{% set url = split_and_get(social.link, "//", 1) %}
{% set title = split_and_get(url, "/", 0) %}
{% endif %}
<a href="{{ social.link }}" target="_blank" rel="{{ rel }}" title="{{ title | e }}" class="md-social__link">
{% include ".icons/" ~ social.icon ~ ".svg" %}
</a>
{% endfor %}
</div>