Possible to remove post date and reading time from specific posts? #80
-
Thank you for this excellent theme! Is it possible to selectively disable the date posted and/or reading time indicators for certain posts? For example, I have a "document" set up as a list of publications, and neither the reading time nor the posted date are relevant there. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I agree with you that those metas are not necessary in docs. But unfortunately, post metas can not be removed for now. I think maybe we can make it configurable in the future. And any PR is welcome! |
Beta Was this translation helpful? Give feedback.
-
I'm just going to add here that there is a way to do this, based on the way Hugo is designed. Anything you put in your /layouts folder overrides anything in the theme. So if you copy the appropriate file from the theme, paste it into /layouts and make your edits to it, you can make any changes you want. Important Caveat: This will effectively fork any pages you copy over, and any future changes or updates made by the theme author will be unavailable to you on any pages you change. You can always delete your overridden pages, update the theme, and then re-apply the changes. But that's more work, and more error-prone And it's always possible that some future update to the theme will be incompatible with any changes you make, and thus break your site in some way (unlikely, perhaps, but possible). So use at your own risk. That said, for this particular example, you can solve this problem by going to your /layouts folder in your site directory. Create a subdirectory named "partials". In that directory, create another subdirectory named "components" When you're done, you should have an empty directory at /layouts/partials/components. Go back up to the root of the website (same level that /layouts was at) and find the /themes directory. Navigate down to /themes/eureka/layouts/partials/components/ and find the file named doc-layout.html This is the file you're interested in for this particular issue. Copy this file wholesale back into your /layouts/partials/components directory that you just created. You now have two copies of this file, one controlled by the theme, and a perfect copy that you're overriding the theme with. Now all you do is edit the copy. In particular, to remove the reading time and post date, you only need to delete line 14, which reads Save and rebuild your site, and voila. |
Beta Was this translation helpful? Give feedback.
I agree with you that those metas are not necessary in docs. But unfortunately, post metas can not be removed for now.
I think maybe we can make it configurable in the future. And any PR is welcome!