Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
adding "authoravatar" config parameter #41
Hi @vjeantet, merci beaucoup for creating this hugo theme! I started porting the original from Ghost and then I found hugo's theme repository and saw that you had already done the hard work for me ;)
I noticed that currently the
If you want to have a picture of the author that is not the same as the logo, it's not currently supported.
This PR uncouples this relationship and creates an explicit configuration for each.
I've also updated the
Let me know if this makes sense and is good to merge into your origin.
Again, thanks so much for the work here!!
Hi @Jean85, thanks for commenting on the PR! I saw the
I've taken a more thorough look into the source code now and I think the problem is currently in 3 places:
My use case is a single-author blog. My apologies that my PR, as it currently stands, does not help address the issue for multiple authors. I am going to work on this now and should have a fix that will work both for me (single-author) and you (multi-author) by tomorrow.
Thanks again for bringing this to my attention.
You're welcome! Thanks to you too!!
Do you think is feasible to use relative (in-Hugo) and absolute (external) URL for thumbnails inside the same parameter? Do we have a way to distinguish them from inside the template?
Currently, only internal thumbnails are supported. The code always uses your site's
It's possible to change this logic to accept external resources, but for now I am going to focus on support for multiple authors with internal thumbnails. We can open another PR down the road which addresses external support.
There were two ways to set up metadata for author. Either you added the
This was a bit confusing and breaks the DRY principle.
Hugo already provides a canonical source for author metadata, the
author: david: name: "David Hasselhoff" bio: "Don't Hassle the Hoff" location: "Baltimore, MD" thumbnail: "images/avatar.jpg"
You can add multiple authors simply by appending them under their own key in the author section. For example:
author: david: name: "David Hasselhoff" bio: "Don't Hassle the Hoff" location: "Baltimore, MD" thumbnail: "images/avatar.jpg" pamela: name: "Pamela Anderson" bio: "Little known fact, I am vegan" location: "Canada" thumbnail: "images/pamela.jpg"
You can then have either a site-wide single author or an author per-post. As long as the
I've also created my own version of this repository which contains all of the fixes here, as well as more. You can get that here:
The README also tries to explain more there.
Why have two places that authors can be configured? Additionally the .Site.Data.Author is non-standard in the Hugo ecosystem and is not obvious to someone looking at the config.yaml. You can't tell what authors are configured for the blog without remembering to check all the files in your site's data/authors directory.
I prefer solutions that are self-documenting and straightforward.
In any case. This all appears to be moot. The author is not joining the conversation and the PR has been outstanding for 3 weeks. I am switching focus over to my own repository to move things forward. You are welcome to continue the discussion there, if it suits you:
Ahhh, gotcha. Yeah, you can see all of the default variables Hugo supports on their documentation page:
I will be moving things forward on my fork.