Help centre · Guide 35
Blog - Headless CMS
Time: 15 minutes. Works with: websites whose content comes from Contentful, Sanity, Strapi (4 or 5) or Storyblok, usually built by a developer or agency. You need: an admin of the CMS, and the names of the blog's fields.
Each CMS stores the article in your existing blog content type. Your website then shows it as usual (some sites need a rebuild: ask your developer to rebuild on publish, which most already do).
Contentful
- Settings > CMA tokens > Create personal access token (Content Management). Copy it.
- Note the Space id (Settings > General settings), the Environment (usually
master) and the blog's Content type id (Content model > your blog type). - In the app: Blog > Add a website > Contentful. Fill in the ids, the Locale (for example
en-USoren-GB) and the field ids for title, slug, body and, if you have them, summary and image. - Body field type:
richtextfor a Rich text field,markdownorhtmlfor a Long text field.
Sanity
- sanity.io/manage > your project > API > Tokens > Add API token with Editor rights. Copy it.
- Note the Project id and Dataset (usually
production) and the document type of posts (oftenpost). - In the app: Blog > Add a website > Sanity. Fill in the details and the field names: body (often
body), image (oftenmainImage), summary and date if your posts have them. - Body format:
portable(Portable Text, the usual),markdownorhtml.
Strapi
- Settings > API Tokens > Create new API token: type Custom, with create and find on your articles collection and upload on Media Library (or Full access). Copy it.
- Note the collection's API name (Content-Type Builder > your collection; for example
articles). - In the app: Blog > Add a website > Strapi. Fill in the Strapi address if it's not your website's address, the token, collection and field names (title, slug, body, and summary and image if you have them).
- Body format:
markdownfor Rich text (Markdown) fields,htmlfor text fields shown as HTML.
Storyblok
- My account > Personal access tokens > Generate. Copy it.
- Note the Space id (Settings > Space), your Region (
eu,us,caorap), the blog folder id and folder slug, and the content type (component) of posts. - In the app: Blog > Add a website > Storyblok and fill these in, with the field names (the body field must be a Markdown or text field).
Then
Press Save, then Test connection. Write and approve a short test article (guide 10) and check it on your site. If article links come out wrong, set Article address pattern, for example {url}/news/{slug}.
These guides are also in the app: Step-by-step guides. Stuck? Email info@sociorelay.com.