-
Notifications
You must be signed in to change notification settings - Fork 450
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
Show count against tag/category #3625
Comments
I love this idea, but I wonder about how the layout would need to change in order to display this information in a mobile friendly way that makes sense. The example you show uses a fully vertical layout, and I rather like the current horizontal list layout the default Nikola theme currently has. |
The main problem with showing numbers is that it requires all pages that include them to be regenerated when any of these counts change. If you have such information in a sidebar, it means that every single page has to be generated when adding a blog post or something, which goes against Nikola's philosophy of incremental builds. But including them in standalone pages (like tags/categories page) should not be a problem.
Or you have a second pass. I'm using that with my sidebar plugin (https://github.com/getnikola/plugins/tree/master/v7/sidebar) and then do a second pass with https://github.com/felixfontein/filetreesubs/ to have this HTML fragment included into every page without forcing Nikola to rebuild all pages. (The substitution step is pretty fast, while a Nikola full rebuild for my blog takes quite a long time.) But this is not trivial to set up... |
@feoh A layout like this could work: (Although I think our tags/categories page looks kinda ugly and unreadable if there are lots of tags and the screen is wide.) |
I didn't get a chance to work on this. If someone is willing to take it up, please go ahead. |
Movable Type provides a nice way of doing this. It allows the sidebar to be defined in a cached template, that is rendered only once, then included in any other site template that needs it, either statically (the once-rendered cached content) or using an Apache or a PHP include server-side. Ways of caching and including are configured as metadata of the template. MT even lets you tell it when to invalidate that cache, for example if there has been a change in the categories, or a new categorised entry added then regenerate this particular template. This way it will only regenerate the minimum amount of files. Using the web server to perform the inclusion dynamically allows to just regenerate a single file and enjoy instant update where regenerating whole lists of pages would be prohibitive. |
Requested Feature: (short description)
In tags page, currently only tags/categories are shown.
Does this feature affect backwards compatibility? If yes, in what way?
No
Do you want to contribute this yourself as a pull request? (don’t worry about it if you don’t want to/can’t — someone else can take care of it)
Rationale and full description: (why should it be added to Nikola?)
Most of the blogging platforms(like blogger, wordpress) have this feature by default. Having count against tag/cateogry gives a glimpse on how many items are present against each tag.
There are nikola plugins that do generate tag count, tag cloud etc. Some of them just generate json files. Users have to setup custom code for front end.
Since nikola already generates taxanomies, showing count along with it will provide better insights by default.
The text was updated successfully, but these errors were encountered: