Setup
Step 1: Create a fine-grained GitHub token
- On GitHub, go to Settings → Developer settings → Personal access tokens → Fine-grained tokens and click Generate new token.
- Under Repository access, choose Only select repositories and pick the repository your site builds from.
- Under Repository permissions, set Contents to Read and write. If you’ll publish via pull request, set Pull requests to Read and write too.
- Generate the token and copy it. Note its expiry date: publishing stops when the token lapses.
Step 2: Connect in ChatFeatured
Open an existing post in your repository to see its branch, folder, extension and front matter keys. Then go to Integrations → Git-based CMS and fill in:
Optionally set up the three options below, then click Connect repository. ChatFeatured checks the token, repository and branch before saving. To change settings later, edit the form and click Update Connection.
Publishing via pull request
By default, ChatFeatured commits straight to your branch. Turn on Publish via pull request if the branch is protected or you want to review posts first. Each publish then opens a pull request from achatfeatured/... branch, and the post goes live when you merge it.
Committing featured images
With Commit featured images off, front matter points to the image where ChatFeatured hosts it. Turn it on and set an Image Folder, such asstatic/blog/uploads, to commit each featured image into your repository. Front matter then uses a site-relative path like /blog/uploads/<slug>.jpg.
Front matter (advanced)
Open Front matter (advanced) to match your theme’s keys. Leave a key blank to use the default:
Under Static keys, click Add key to add keys that go into every post, such as
_schema: default.
A default file looks like this:
Publish an article
In the article editor, click Publish or Schedule and choose the Git-based CMS. The dialog has Publish Status, Author (optional), Tags and, for Schedule, a date, time and timezone. Save as Draft only appears once you’ve set a Draft flag key, such asdraft. Without one, generators like Hugo treat every committed post as live.
To change a published article, choose Unpublish from its menu in the Articles list, edit it, then publish again. The
date stays the original publish date.
Troubleshooting
GitHub rejected the token. Check that the fine-grained personal access token is valid and not expired.
GitHub rejected the token. Check that the fine-grained personal access token is valid and not expired.
The token expired, was revoked, or wasn’t copied in full. Generate a new one (Step 1), paste it into GitHub Access Token, and click Update Connection.
Repository not found. Check the owner/name and make sure the token is scoped to this repository.
Repository not found. Check the owner/name and make sure the token is scoped to this repository.
Enter the repository as
owner/repo-name. Fine-grained tokens only see the repositories picked when they were created, so you may need a new token with the right repository selected.The commit is there but the post isn't on the site
The commit is there but the post isn't on the site
Find the
via ChatFeatured commit in your repository’s history, then check your CMS’s sync and build logs. Hugo hides future-dated posts by default, so check the date, and the draft key if you use one.Related
All integrations
Every CMS and analytics integration ChatFeatured supports.
Articles
How articles move from idea to published.