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 |
Kwpolska
Oct 16, 2016
Member
Do we have any use case for minimum_post_count_per_classification_in_overview and omit_empty_classifications?
Do we have any use case for minimum_post_count_per_classification_in_overview and omit_empty_classifications?
felixfontein
Oct 16, 2016
Author
Contributor
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).
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.""" |
Kwpolska
Oct 16, 2016
Member
Add a note about this and sort_classifications being in-place.
Add a note about this and sort_classifications being in-place.
felixfontein
Oct 16, 2016
Author
Contributor
I adjusted that.
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` |
Kwpolska
Oct 16, 2016
Member
utils.TreeNode (which I haven’t known about before)
utils.TreeNode (which I haven’t known about before)
felixfontein
Oct 16, 2016
Author
Contributor
I think I introduced them for category hierarchies.
I think I introduced them for category hierarchies.
Kwpolska
Oct 16, 2016
Member
There are lots of features I never used, and category hierarchies are one of them.
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 |
|
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 :)