mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-28 08:42:47 -04:00
Added support for linking authors in blog posts
Co-authored-by: alexvoss <4134224+alexvoss@users.noreply.github.com>
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
from mkdocs.config.base import Config
|
||||
from mkdocs.config.config_options import DictOfItems, SubConfig, Type
|
||||
from mkdocs.config.config_options import DictOfItems, Optional, SubConfig, Type
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Classes
|
||||
@@ -30,6 +30,7 @@ class Author(Config):
|
||||
name = Type(str)
|
||||
description = Type(str)
|
||||
avatar = Type(str)
|
||||
url = Optional(Type(str))
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -59,7 +59,14 @@
|
||||
<img src="{{ author.avatar }}" alt="{{ author.name }}" />
|
||||
</span>
|
||||
<span class="md-profile__description">
|
||||
<strong>{{ author.name }}</strong><br />
|
||||
<strong>
|
||||
{% if author.url %}
|
||||
<a href="{{ author.url }}">{{ author.name }}</a>
|
||||
{% else %}
|
||||
{{ author.name }}
|
||||
{% endif %}
|
||||
</strong>
|
||||
<br />
|
||||
{{ author.description }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user