Update content to use consistent quotes.

Also made a small change to the section title to make it a bit more
clear.
This commit is contained in:
iUnknwn 2021-10-04 21:33:51 -07:00
commit c1e0182a2e

View file

@ -301,14 +301,14 @@ Here is a basic example of how to set up your own writer::
signals.get_writer.connect(add_writer) signals.get_writer.connect(add_writer)
Modifying Generators to Inject Content Using Plugins to Inject Content
--------------------------------------- ---------------------------------------
You can programatically inject articles or pages using plugins. This can be You can programatically inject articles or pages using plugins. This can be
useful if you plan to fetch articles from an API, for example. useful if you plan to fetch articles from an API, for example.
Here is a very simple example of how we can build a plugin that injects Here is a very simple example of how we can build a plugin that injects a
custom articles, using the article `article_generator_pretaxonomy` signal:: custom article, using the article `article_generator_pretaxonomy` signal::
from pelican import signals from pelican import signals
from pelican.contents import Article from pelican.contents import Article
@ -327,8 +327,8 @@ custom articles, using the article `article_generator_pretaxonomy` signal::
newArticle = Article(content, { newArticle = Article(content, {
"title": "Injected Article!", "title": "Injected Article!",
"date": datetime.datetime.now(), "date": datetime.datetime.now(),
"category": baseReader.process_metadata('category', 'fromAPI'), "category": baseReader.process_metadata("category", "fromAPI"),
"tags": baseReader.process_metadata("tags", 'tagA, tagB') "tags": baseReader.process_metadata("tags", "tagA, tagB")
}) })
articleGenerator.articles.insert(0, newArticle) articleGenerator.articles.insert(0, newArticle)