Linking to an image file for the avatar in authors.yml #5769
Replies: 2 comments 3 replies
-
As stated in the documentation "This property must point to a valid image URL, internal or external, and is used as part of posts and excerpts as the author's avatar." So you have to provide the mkdocs-material/material/blog-post.html Lines 22 to 36 in cf7ca44 So in other words: |
Beta Was this translation helpful? Give feedback.
-
I encountered the same issue when referencing an avatar image with a relative path on local filesystem, but not sure it should be categorized as a bug or lack-of-feature. I have a pure blog structure as suggested at https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/?h=blog#blog-only, and my avatar image file is at In my |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am having a hard time understanding how to link to a relative image file in the
.authors.yml
as described in the help here. In the docs, a web url (avatar: https://github.com/squidfunk.png
) is used so it is not useful to understand in my case how to set up this path.My
.authors.yml
file is underdocs/blog/.authors.yml
as suggested in the docs. My avatar is underdocs/blog/assets/avatar/ldupeloux.jpg
.I tried many paths in the
.authors.yml
, but never get a chance to make it work for both the blog index and post page, and for both localmkdocs serve
andmkdocs build
(I am using build withoffline plugin enabled
).I also noticed that I have to define the path to the
.authors.yml
asauthors_file: ./blog/.authors.yml
, that is relative to the site root, and not to theblog_dir
as explained in the docs [here}(https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/?h=authors_file#+blog.authors_file). Indeed, If i define it toauthors_file: ./.authors.yml
mkdocs complains that the authorldupeloux
could not be found.How should I specify the avatar path ? Relative to the site root ? Relative to the
.authors.yml
? And what about theauthors_file
?Many thanks for your help. I'am quite confused about how it is working, despite all my readings, searching, and tests !
Beta Was this translation helpful? Give feedback.
All reactions