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
Experiments for generalization of taxonomies. #2535
Conversation
apply_to_posts = True | ||
# Whether this classification applies to pages. | ||
apply_to_pages = False | ||
# The minimum number of posts a classification must have to be listed in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any use case for minimum_post_count_per_classification_in_overview and omit_empty_classifications?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minimum_post_count_per_classification_in_overview
will be site.config['TAGLIST_MINIMUM_POSTS']
for tags.
omit_empty_classifications
allows to prevent some collisions if you have also_create_classifications_from_other_languages
enabled (which seems to be the default for tags and categories in the current implementation).
raise NotImplementedError() | ||
|
||
def sort_posts(self, posts, classification, lang): | ||
"""Sort the given list of posts.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a note about this and sort_classifications being in-place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adjusted that.
For compatibility reasons, the list could be stored somewhere else as well. | ||
|
||
In case `has_hierarchy` is `True`, `flat_hierarchy_per_lang` is the flat | ||
hierarchy consisting of `TreeNode` elements, and `hierarchy_lookup_per_lang` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utils.TreeNode (which I haven’t known about before)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I introduced them for category hierarchies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are lots of features I never used, and category hierarchies are one of them.
@felixfontein don't worry much about codacy, I was just curious about how it worked. It finds interesting stuff, tho! |
It did find some unused imports |
@felixfontein Is this mergeable? |
Yes, I think so. From my side the branch is complete. The result should get a bit more testing with some more real-life blogs before a new version of Nikola is released, though. I've tested it with my blogs and with yours, but that doesn't cover all edge cases :) |
Codacy isn’t some magic. That’s just pylint as a service, which has been configured to be less nitpicky. |
Should we merge? Or wait some more? |
Please test with nikola-site first. And if you have some spare time, try to increase test coverage of the new features (if you don’t, we’ll merge now). |
…disabled taxonomies.
|
Merging then. Thanks for all the effort you put in this PR! |
Thanks for all the feedback and merging! |
Here’s an issue, detected with nikola-logs: |
Uh, that won’t cut it. I had to disable |
The plugin's name is now |
May I request to restore the old names? That way, we won’t break backwards compatibility with existing blogs. |
That doesn't work because there is no 1:1 mapping between old and new names. I could add some hack which detects the old names in |
👍 for that (let’s move the discussion to #2581). |
This is about #2107. I added a new plugin category,
Taxonomy
, as well as two plugins which take care to classify posts with allTaxonomy
plugins and render all associated pages for them.The next step is re-implementing the following plugins with this framework and see if it works:
archive
authors
indexes
(needs to be split up into two plugins, one for the main index and one for section indexes)It's not possible to recreate the
tags
plugin with this framework as it contains the option (which is even default!) to put tags and categories onto the same overview page. But that problem will be solved in v8 anyway when categories go away :)