mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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:
parent
3141a82ffe
commit
c1e0182a2e
1 changed files with 5 additions and 5 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue