mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-05-14 20:21:43 -04:00
28 lines
885 B
HTML
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>
|