mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Added support for linking authors in blog posts
Co-authored-by: alexvoss <4134224+alexvoss@users.noreply.github.com>
This commit is contained in:
parent
9c01605149
commit
28ebcbfb59
@ -3,7 +3,9 @@ authors:
|
|||||||
name: Martin Donath
|
name: Martin Donath
|
||||||
description: Creator
|
description: Creator
|
||||||
avatar: https://avatars.githubusercontent.com/u/932156
|
avatar: https://avatars.githubusercontent.com/u/932156
|
||||||
|
url: https://github.com/squidfunk
|
||||||
alexvoss:
|
alexvoss:
|
||||||
name: Alex Voss
|
name: Alex Voss
|
||||||
description: Community support
|
description: Community support
|
||||||
avatar: https://avatars.githubusercontent.com/u/4134224
|
avatar: https://avatars.githubusercontent.com/u/4134224
|
||||||
|
url: https://github.com/alexvoss
|
||||||
|
@ -1205,6 +1205,7 @@ The provided path is resolved from the [`docs` directory][mkdocs.docs_dir].
|
|||||||
name: string # Author name
|
name: string # Author name
|
||||||
description: string # Author description
|
description: string # Author description
|
||||||
avatar: url # Author avatar
|
avatar: url # Author avatar
|
||||||
|
url: url # Author website URL
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that `<author>` must be set to an identifier for associating authors
|
Note that `<author>` must be set to an identifier for associating authors
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
# IN THE SOFTWARE.
|
# IN THE SOFTWARE.
|
||||||
|
|
||||||
from mkdocs.config.base import Config
|
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
|
# Classes
|
||||||
@ -30,6 +30,7 @@ class Author(Config):
|
|||||||
name = Type(str)
|
name = Type(str)
|
||||||
description = Type(str)
|
description = Type(str)
|
||||||
avatar = Type(str)
|
avatar = Type(str)
|
||||||
|
url = Optional(Type(str))
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -27,7 +27,14 @@
|
|||||||
<img src="{{ author.avatar }}" alt="{{ author.name }}">
|
<img src="{{ author.avatar }}" alt="{{ author.name }}">
|
||||||
</span>
|
</span>
|
||||||
<span class="md-profile__description">
|
<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 }}
|
{{ author.description }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
# IN THE SOFTWARE.
|
# IN THE SOFTWARE.
|
||||||
|
|
||||||
from mkdocs.config.base import Config
|
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
|
# Classes
|
||||||
@ -30,6 +30,7 @@ class Author(Config):
|
|||||||
name = Type(str)
|
name = Type(str)
|
||||||
description = Type(str)
|
description = Type(str)
|
||||||
avatar = Type(str)
|
avatar = Type(str)
|
||||||
|
url = Optional(Type(str))
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -59,7 +59,14 @@
|
|||||||
<img src="{{ author.avatar }}" alt="{{ author.name }}" />
|
<img src="{{ author.avatar }}" alt="{{ author.name }}" />
|
||||||
</span>
|
</span>
|
||||||
<span class="md-profile__description">
|
<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 }}
|
{{ author.description }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user