-
Notifications
You must be signed in to change notification settings - Fork 153
Add options to hide list dates #115
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
Conversation
Sorry for the late reply.
This is not needed, if you don't include the date in your page, it's not added. (To be fair, you also need to remove read time, otherwise you see something like But I guess not having a date has some implications, like page ordering.
This could be a nice idea, where would someone need to specify this parameter? The wiki you wrote hints at putting it in the hugo.toml, but this would be a parameter in the collection itself, so
Please don't do it, the idea is to showcase how a website would normally (assuming most people keep dates on) look. |
Okay, I can update the templates to use the
Hugo has a
In that case the wiki is ambiguous, as I interpreted the Collections parameters as parameters that should be added to collection (list) pages, so that is why I put it there. Why would you prefer global collection options in Please let me know where you want to have this parameter documented if the Collections page is not the right place.
Sure, I'll revert those changes. |
Hi @tomfran, I would still like to complete this contribution, but I cannot do that without an answer to my previous question. Could you please let me know where you want to have the |
Sorry for the late reply.
Honestly when developing the theme I did not researched heavily in what's was possible, so global collection parameters were designed. I believe it prevents inconsistencies, and also is a fast and easy way to control everything in one place.
Does this mean that if I set, for example, the If this is the case, I would simply add your parameter in a new section under collections. We can also add a preamble in the page mentioning that parameters can be overridden for a single collection by adding a |
Yes, it will override the global setting for that collection, but cascading does more than that: https://gohugo.io/configuration/cascade/ The following configuration in [cascade.params]
listDateFormat = 'Jan 2006'
showListDate = false
[cascade.target]
path = '{/publications,/publications/**}' |
@tomfran I removed the |
Thank you! I haven’t forgotten about this, I just haven’t had much time lately. I’ll take a look soon. :) |
Add options to hide list dates (tomfran#115)
In some cases, it can be useful to hide the post dates in post lists. This PR adds two configuration options to hide dates:
showDate
on single pages to show or hide the publication date on single pages;showListDate
on list pages to show or hide the publication date on list pages.Both parameters default to true. I chose to configure the date display behaviour for collections on the list page; this may lead to edge cases when nested collections are used, but these can be mitigated by manually specifying the date display behavior on the list pages for nested collections as well. I don't expect nested collections to be used that often.
An alternative implementation could use a parameter on the list (or home) page which is then passed to the
post-entry
partial. Let me know if you prefer that over the current solution.I also updated the features section of the wiki, as I think hiding dates on the features page would make sense. However, as only the content of the wiki is available in this repository, I cannot build the wiki to check what it looks like. Please let me know if the wiki still builds after these changes.