-
Notifications
You must be signed in to change notification settings - Fork 99
Description
I was a bit confused with the medium and devto plugins
(not sure other plugins have this problem).
The documentation says:
At that point your posts with the "devto" metadata set to "yes" or "true" should be published.
But I have a hard time remembering all the keywords, so I set the standard keywords to
medium: False
devto: False
This will lead medium and devto to publish all articles, due to something that I'd say is unintuitive and should be changed to improve usability.
The code says:
plugins/v8/devto/devto_plugin.py
Line 67 in c930557
| to_post = [post for post in posts if post.title() not in devto_titles and post.meta('devto')] |
plugins/v8/medium/medium_plugin.py
Line 69 in c930557
| if post.title() not in medium_titles and post.meta("medium") |
since post.meta('devto') is text, it will always be true, regardless of the value it was set.
(Pseudo-)Boolean keywords like this should probably have an "off" switch.
Locally, I changed mine to:
to_post = [post for post in posts if post.title() not in devto_titles and (post.meta('devto').lower() in ["yes", "true"])]I don't know if that's the best way to handle it. Happy to discuss solutions and make a pull request.