contentful
Import posts and pages from Contenful CMS
To install, run nikola plugin -i contentful
What is this?
This plugin lets integrate Nikola with a Contentful site, thus allowing you to use a web UI to create and edit posts and pages.
How to Use it
- Setup your Contentful site:
- In the Content model, set up Post and Page as content types (API identifier must be
post
andpage
respectively) - Both content types must have
title
,slug
,date
,content
fields. - Create the
content
field as “text” (NOT “rich text”) with Markdown appearance. - Any other fields will be part of the post metadata (you might want
tags
there, for example) - Install the plugin using
nikola plugin -i contentful
- Obtain a access token and space ID from your Contentful space and put them in a contentful.json like this:
{
"SPACE_ID": "t2gxqu19qu62",
"ACCESS_TOKEN": "dd167cf8b111d9e17a46059d"
}
- In your conf.py, add
contentful/posts/*.md
toPOSTS
andcontentful/pages/*.md
toPAGES
. Seeconf.py.sample
for an example. - Run
nikola contentful
.
At that point your pages and posts created in Contentful should be ready for you to use. Have fun!
Suggested Configuration:
# In order to use the Contentful CMS you need to add the contentful/posts and contentful/pages # folders to your POSTS and PAGES settings POSTS = ( ... ("contentful/posts/*.md", "posts", "post.tmpl"), ) PAGES = ( ... ("contentful/pages/*.md", "pages", "page.tmpl"), )
Requirements:
- contentful (Python package)
- ruamel.yaml>=0.15 (Python package)
Issues? Questions?
You can report issues with this plugin and request help via GitHub Issues.