-
Notifications
You must be signed in to change notification settings - Fork 188
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
More categories plugin support #619
base: next
Are you sure you want to change the base?
More categories plugin support #619
Conversation
Thank you @vokimon. I will review and merge the PR soon. |
9ec8ba5
to
2c3d84a
Compare
Thanks. I did some further changes required to pass all automatic checks. Waiting for your human review. The invariant is: output should look identical if you just activate or desactivate more-categories plugin and they only look different when you define an article with multiple categories. Regarding the keywords meta, i fixed my fix, by testing with and without the plugin and with and without tags, keywords, categories. I don't know whether the project has any kind of automated testing but it would be nice to automate those test cases. |
6385ac2
to
a7e0cc4
Compare
a7e0cc4
to
bd1e37d
Compare
bd1e37d
to
732172f
Compare
Hi @vokimon , sorry for the delay. I've tested it, but I couldn't get it to work (I even rebased against of top of next branch). I've downloaded the more_categories plugin and tested both with So I'm wondering that something might be missing with the actual status of pelican + Elegant. Would you mind updating the PR (with rebase) so that I can attempt again testing it? Thanks! |
My traceback :-) |
732172f
to
bbe8f77
Compare
One year and two months after the PR it's hard for me to recall the intent of the code, but taking a look at it i would say that categories:
- cat1
- cat2
- dog I don't recall if at any point of the metadata reading, comma separated strings were turn into a list as well. In such case, it looks like it is not happening. All my personal uses of the extension use yaml lists. |
The `more_categories` plugin enables having more than one category for a single article by separating them with commas. This commit comprises the required template changes to display all related categories instead of just one. The change is safe when the plugin is not used. It changes the category list in the last article section of the index and in the article page. It also modifies the keyword meta, to use all categories. This commit also fixes an unreported bug with the keyword meta: when no keywords or tags are specified, pointless commas were added at the beginning or the end.
Because keywords is not a list but a string with comma separated values, every letter was separated. Instead, just take it as a single item and lets append it as a single item, but if empty append an empty list. Also, for categories, when no category and no categories plugin is found resulted in [None].
bbe8f77
to
d45a5fe
Compare
Prerequisites
next
branchRecommended Steps
Description
This PR includes support for having multiple categories in an article by means of
more-categories
plugin and template changes in this PR.Templates changes keep the behavior on deployments not using the plugin. Whenever the attribute
article.categories
(added bymore-categories
) is missing, it constructs single category list[article.category]
and proceeds.Fixes #618: Since i had to update the keyword meta tag properly, this PR also fixes that issue. I could send a specific PR to fix just that if accepting this PR takes longer or it is not accepted.