-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
References to .Site.Authors need to be cleaned up? #4458
Comments
This duplicates #3088 and others. In general, we have some features that does not exist in the documentation, which means "it doesn't exist". |
I can understand that, but then they also need to be cleaned up from the internal templates. I discovered this problem as I was debugging why the templates were not setting the That's very confusing. |
@bep Would you consider reopening this? This is not a duplicate. This issue is about cleaning up the templates so that they don't refer to the non-functional variables. It plainly causes confusion. Once the Author proposal in your referred issue is implemented, the templates can be updated accordingly. At the moment, the templates are trying to access an unimplemented feature, which I categorize as a bug. |
Agreed, this is something I just hit myself. |
When .Site.Authors is a map (as the docs say) this works correctly (according to my testing). I'd argue the docs need to be updated with examples of how to properly configure .Site.Authors rather removing it's usage (I'm planning on doing this today / tomorrow). Part of the problem is that even hugoBasicExample doesn't do this right (gohugoio/hugoBasicExample#69) but I fix that in (gohugoio/hugoBasicExample#70). |
That's great! Please show me how to make it work! |
I think I may be misunderstanding part of this -- .Site.Authors allows to access the keys in the config.toml map which is all that I ever found in the docs. The other issue you mention in gohugoio/hugoDocs#1370 is something I never found or noticed (and I think is a separate discussion/feature). |
Again, please show me how to make this work. |
Ok. Oh wait. I didn't notice the plural. .Site.Author is what I was referring to. Sorry for the confusion. I guess the templates really should use .Site.Author.authors (as described in https://discourse.gohugo.io/t/site-author-usage/31459/10), rather than .Site.Authors (and documentation updated). |
That's a separate issue. This issue is about removing the stuff that does not work. We can add stuff that does work if/when there is a consensus on data structure and associated documentation. Currently the data structure of |
Fair enough. In that case probably the RSS feed shouldn't use hardcoded keys from .Site.Author either, although that is for another PR/discussion, I think. |
Personally, I use the embedded templates as a starting point, copying them to my projects and then tweaking them to meet my needs or match my data structures. |
@jmooring By that logic why not just update these templates with |
Because that's what I do. I have no idea what everyone else does. My objective with this issue and the associated PR is to remove what is broken. If we want to replace it with something, it should be by consensus. There's a long standing open issue that is directly related to how this is handled, #3088. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello,
I had opened up https://discourse.gohugo.io/t/site-authors-not-implemented/10446 on Discourse for discussion, but haven't received any feedback.
The gist of the problem is that internal templates like
twitter_cards
andopengraph
reference.Site.Authors
, but no matter what I do, those variables do not get set.While diving through the Hugo source code through my Go-unexperienced eyes, I realized that those variables are "declared" but never "assigned" (not sure what the correct Go-lingo is for that).
You can read the above linked Discourse thread for details and code snippet references.
The text was updated successfully, but these errors were encountered: