mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Only show authors' email addresses if so configured in git-authors (#6494)
Honour the git-authors plugin's setting to render the authors' names as links pointing to their email address: * If the git-authors plugin is enabled and its show_email_address option is not set, or is set to true, render the author's name as a "mailto:" link. * If the git-authors plugin is enabled and its show_email_address option is set to false, render the author's name in plain text with no link. * If the git-authors plugin is not enabled (or not installed), don't show author information.
This commit is contained in:
parent
2ca5cf0ea0
commit
9b98c77725
@ -18,6 +18,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
{% macro render_authors(authors) %}
|
{% macro render_authors(authors) %}
|
||||||
|
{% set git_authors = config.plugins.get("git-authors") %}
|
||||||
<span class="md-source-file__fact">
|
<span class="md-source-file__fact">
|
||||||
<span class="md-icon" title="{{ lang.t('source.file.contributors') }}">
|
<span class="md-icon" title="{{ lang.t('source.file.contributors') }}">
|
||||||
{% if authors | length == 1 %}
|
{% if authors | length == 1 %}
|
||||||
@ -28,9 +29,13 @@
|
|||||||
</span>
|
</span>
|
||||||
<nav>
|
<nav>
|
||||||
{% for author in authors %}
|
{% for author in authors %}
|
||||||
|
{%- if git_authors.config.show_email_address %}
|
||||||
<a href="mailto:{{ author.email }}">
|
<a href="mailto:{{ author.email }}">
|
||||||
{{- author.name -}}
|
{{- author.name -}}
|
||||||
</a>
|
</a>
|
||||||
|
{%- else -%}
|
||||||
|
{{- author.name -}}
|
||||||
|
{% endif -%}
|
||||||
{%- if loop.revindex > 1 %}, {% endif -%}
|
{%- if loop.revindex > 1 %}, {% endif -%}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
|
|
||||||
<!-- Render authors -->
|
<!-- Render authors -->
|
||||||
{% macro render_authors(authors) %}
|
{% macro render_authors(authors) %}
|
||||||
|
{% set git_authors = config.plugins.get("git-authors") %}
|
||||||
<span class="md-source-file__fact">
|
<span class="md-source-file__fact">
|
||||||
<span class="md-icon" title="{{ lang.t('source.file.contributors') }}">
|
<span class="md-icon" title="{{ lang.t('source.file.contributors') }}">
|
||||||
{% if authors | length == 1 %}
|
{% if authors | length == 1 %}
|
||||||
@ -54,9 +55,13 @@
|
|||||||
</span>
|
</span>
|
||||||
<nav>
|
<nav>
|
||||||
{% for author in authors %}
|
{% for author in authors %}
|
||||||
|
{%- if git_authors.config.show_email_address %}
|
||||||
<a href="mailto:{{ author.email }}">
|
<a href="mailto:{{ author.email }}">
|
||||||
{{- author.name -}}
|
{{- author.name -}}
|
||||||
</a>
|
</a>
|
||||||
|
{%- else -%}
|
||||||
|
{{- author.name -}}
|
||||||
|
{% endif -%}
|
||||||
{%- if loop.revindex > 1 %}, {% endif -%}
|
{%- if loop.revindex > 1 %}, {% endif -%}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</nav>
|
</nav>
|
||||||
|
Loading…
Reference in New Issue
Block a user