Update docs with example on injecting articles#2922
Update docs with example on injecting articles#2922iUnknwn wants to merge 2 commits intogetpelican:masterfrom
Conversation
Updated the plugin documentation to add a recipe for adding articles programatically when pelican is running.
docs/plugins.rst
Outdated
| "title": "Injected Article!", | ||
| "date": datetime.datetime.now(), | ||
| "category": baseReader.process_metadata('category', 'fromAPI'), | ||
| "tags": baseReader.process_metadata("tags", 'tagA, tagB') |
There was a problem hiding this comment.
Random switch between single-quoted and double-quoted strings is triggering me a bit :).
|
I like the idea but if go down this route we can end up with countless little recipes here (plugins can do a lot). Maybe it's better to move this to its own document (like |
|
I'm happy to pull out the plugin examples into another page, if that would be better. Also happy to normalize the quotes. I do think that more documentation on the plugins overall is a good thing, though, both in terms of explaining what plugins can do (the docs focus on building new readers and generators, but not interacting with them), and showing how extendable pelican can be (discovering I could use hugo/liquid-style short codes by extending markdown was insanely helpful, but I never would have realized that was possible from the docs alone). |
|
Just to follow up, would you like me to separate out the plugin examples and additional docs onto a separate page? |
|
I think it's still manageable as is, so let's keep it in same page. If you can normalize the quotes, I'll approve. |
Also made a small change to the section title to make it a bit more clear.
|
Sounds good. I normalized the quotes, and adjusted the section title to be a bit more simple/direct. |
Updated the plugin documentation to add a recipe for adding articles programmatically when pelican is running.
I struggled to understand how to dynamically add content to Pelican (for example, if I wanted to fetch content via an API rather than from Markdown). Once I got it working, I wanted to update the docs so it was a bit easier for the next person. Hopefully this is the preferred way to inject dynamic content (as far as I can tell - this seems like it would be the correct signal).
Pull Request Checklist
N/A - updating documentation only - no code changes.