-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding "authoravatar" config parameter #41
Conversation
currently, the “logo” variable represents *two* states: - the logo at the top-left of the website - the picture for the post’s author this commit uncouples this relationship and creates an explicit configuration for each. “logo” now only represents the image at the left-hand corner of the website and the new “authoravatar” represents the image of the author.
Wait, this is already implemented with the 👎 |
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. |
Mmmh... Maybe just removing |
@Jean85 yep, that's exactly what I was thinking. but I want to keep focused and not change this PR's scope. There are multiple places in the theme that will need to change in order to support external image references. |
- no longer dependent on Site.Data, we now use Site.Author as the canonical source for Author metadata - correctly checking for author setting on the post front-matter *or* the site's config file - thumbnails now work on both list and single layouts
@Jean85 I think this should all be addressed now with the latest commit 8206674. There is a major change in the way authors are configured, however. Read on for the details. Old WayThere were two ways to set up metadata for author. Either you added the This was a bit confusing and breaks the DRY principle. New WayHugo 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. |
I'm not sure about breaking the DRY... The author specified in the config is the "default" author, that can be (optionally) overwritten in the front matter. Why this should be an issue? |
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: |
I'm not very familiar with Hugo, I didn't know that this wasn't a standard approach. Thanks, I'll look into your fork. |
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. |
@Jean85 just a last heads up, I've also implemented the changes needed for absolute images, which was another request you had. Here is the commit for this change in hasper: |
Woha great! Thanks! |
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
logo
variable onconfig.toml
represents two states: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.
logo
now only represents the image at the left-hand corner of the website and the newauthoravatar
representsthe image of the author.
I've also updated the
README.md
so that the documentation reflects these changes.Let me know if this makes sense and is good to merge into your origin.
Again, thanks so much for the work here!!
--Dennis