diff --git a/docs/blog/.authors.yml b/docs/blog/.authors.yml index 6a4302069..cd63d3097 100644 --- a/docs/blog/.authors.yml +++ b/docs/blog/.authors.yml @@ -3,7 +3,9 @@ authors: name: Martin Donath description: Creator avatar: https://avatars.githubusercontent.com/u/932156 + url: https://github.com/squidfunk alexvoss: name: Alex Voss description: Community support avatar: https://avatars.githubusercontent.com/u/4134224 + url: https://github.com/alexvoss diff --git a/docs/plugins/blog.md b/docs/plugins/blog.md index 488770799..227a30913 100644 --- a/docs/plugins/blog.md +++ b/docs/plugins/blog.md @@ -1205,6 +1205,7 @@ The provided path is resolved from the [`docs` directory][mkdocs.docs_dir]. name: string # Author name description: string # Author description avatar: url # Author avatar + url: url # Author website URL ``` Note that `` must be set to an identifier for associating authors diff --git a/material/plugins/blog/author.py b/material/plugins/blog/author.py index 1dcfc2de2..5fb457b19 100644 --- a/material/plugins/blog/author.py +++ b/material/plugins/blog/author.py @@ -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)) # ----------------------------------------------------------------------------- diff --git a/material/templates/blog-post.html b/material/templates/blog-post.html index 8e3e5f2c5..6804a6af9 100644 --- a/material/templates/blog-post.html +++ b/material/templates/blog-post.html @@ -27,7 +27,14 @@ {{ author.name }} - {{ author.name }}
+ + {% if author.url %} + {{ author.name }} + {% else %} + {{ author.name }} + {% endif %} + +
{{ author.description }}
diff --git a/src/plugins/blog/author.py b/src/plugins/blog/author.py index 1dcfc2de2..5fb457b19 100644 --- a/src/plugins/blog/author.py +++ b/src/plugins/blog/author.py @@ -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)) # ----------------------------------------------------------------------------- diff --git a/src/templates/blog-post.html b/src/templates/blog-post.html index 73fb669f7..21abd499d 100644 --- a/src/templates/blog-post.html +++ b/src/templates/blog-post.html @@ -59,7 +59,14 @@ {{ author.name }} - {{ author.name }}
+ + {% if author.url %} + {{ author.name }} + {% else %} + {{ author.name }} + {% endif %} + +
{{ author.description }}