How it works
Unlike API-based CMS platforms, a Git-based CMS has no content API — the repository is the CMS. When you click Publish in ChatFeatured, we:- Convert your article to markdown with YAML front matter matching your site’s schema
- Commit it to your repository (e.g.
content/posts/your-article-slug.md) - Your CMS detects the commit, syncs, and your site rebuilds
Because articles land as normal files in your repository, your team can still open and edit them in your CMS’s editor afterward. Those edits are preserved — republishing from ChatFeatured always reads the file’s latest state before updating it.
Prerequisites
- A site whose content lives as markdown in a GitHub repository
- Permission to create a fine-grained personal access token for that repository (or someone on your team who can)
Setup Instructions
Step 1: Create a Fine-Grained GitHub Token
- On GitHub, go to Settings → Developer settings → Personal access tokens → Fine-grained tokens
- Click “Generate new token”
- Under Repository access, choose “Only select repositories” and pick the repository your site builds from
- Under Permissions → Repository permissions, set Contents to Read and write. If you plan to publish via pull request, also set Pull requests to Read and write
- Generate the token and copy it (it starts with
github_pat_)
Step 2: Find Your Branch and Content Path
- Branch: the branch your CMS syncs and builds from (often
main) - Content path: the repository folder where your blog posts live — for example
content/postson Hugo sites, orcontentfor many Astro and Next.js sites - Open an existing post file in your repository to confirm the folder and see your front matter format. Note the file extension too — if your posts are
.mdxfiles, set File format to.mdxin the integration settings so published posts match (some content pipelines only pick up one extension)
Step 3: Connect in ChatFeatured
- In ChatFeatured, go to Integrations → Git-based CMS
- Enter your GitHub Repository as
owner/repo-name - Enter the Branch and Content Path from Step 2
- Paste your GitHub Access Token from Step 1
- Optionally enter your Site URL (e.g.
https://www.example.com) so ChatFeatured can link to published posts - Optionally enter a URL Pattern (e.g.
/blog/{slug}/) describing how your site turns a post into its live URL. Leave it blank to derive the URL from the content path, which matches Hugo’s default - Click “Connect repository” — the connection is tested against your repository before saving
Step 4 (Optional): Commit Featured Images to Your Repo
By default, published posts reference featured images by their ChatFeatured CDN URL. If your site expects local images:- Turn on “Commit featured images” in the integration settings
- Enter your Image Folder — the repository folder where images belong (e.g.
static/blog/uploadsfor Hugo)
<folder>/<slug>.<ext>, and references it site-relative in front matter. A leading static/ (Hugo) or public/ (Astro, Next.js, Eleventy) is dropped automatically, so static/blog/uploads produces /blog/uploads/your-slug.jpg.
Step 5 (Optional): Publish via Pull Request
By default, publishing commits straight to your configured branch. If that branch is protected, or you want to review posts before they go live, turn on “Publish via pull request” in the integration settings. Each publish then:- Commits the post to a ChatFeatured-owned
chatfeatured/*branch (named after the post’s file path) - Opens a pull request against your configured branch
- Goes live when someone on your team merges the pull request (close it instead to discard the post)
Pull-request publishing requires the token to have Pull requests: Read and write in addition to Contents — the connection test checks this when you save.
Publishing Articles
Publish an Article
- In ChatFeatured, click Publish on your article
- ChatFeatured commits the markdown file to your repository with a commit message like
Publish "Your Title" via ChatFeatured - Your CMS syncs the commit and your site rebuilds — the post is typically live within a minute or two, depending on your build time
Update an Article
Republishing an article commits an update to the same file — even if the article’s slug changed in ChatFeatured, the original file path is reused so your live URL never breaks.Unpublish an Article
Unpublishing in ChatFeatured commits a deletion of the markdown file, and the post comes down from your site on the next build.Schedule an Article
Scheduled articles are committed at the scheduled time, not when you schedule them — nothing appears in your repository until the publish moment arrives. Cancelling or rescheduling in ChatFeatured works as expected. If a scheduled publish fails (for example, the token was revoked), the article returns to review status and the scheduler is notified by email.Front Matter
By default, published posts include this front matter:- description comes from the article’s meta description (or excerpt)
- keywords are the article’s target keywords from ChatFeatured
- date is preserved on republish, so editing an article never changes its visible publish date
categories vs tags, summary vs description, custom keys like _schema). ChatFeatured supports per-site key mapping and static keys so the generated files match your existing posts exactly — contact support with an example post file from your repository and we’ll configure it for your site.
Troubleshooting
'GitHub rejected the token' Error
'GitHub rejected the token' Error
Cause: The token is invalid, expired, or was revokedSolution:
- Generate a new fine-grained token (Step 1) and update it in the integration settings
- Fine-grained tokens have an expiration date — check whether yours lapsed
- Confirm the token was copied completely (it starts with
github_pat_)
'Repository not found' Error
'Repository not found' Error
Cause: Wrong owner/name, or the token isn’t scoped to this repositorySolution:
- Check the repository is entered as
owner/repo-namewith correct spelling - Fine-grained tokens only see the repositories selected when they were created — regenerate the token with the right repository selected
'Branch not found' Error
'Branch not found' Error
Cause: The branch name doesn’t exist in the repositorySolution:
- Check which branch your CMS builds from in its site settings
- Branch names are case-sensitive
'The token can read the repository but cannot write to it' Error
'The token can read the repository but cannot write to it' Error
Cause: The token’s Contents permission is read-onlySolution:
- Edit the token on GitHub and set Contents to Read and write, or generate a new one
Article committed but not appearing on the live site
Article committed but not appearing on the live site
Cause: Your CMS’s sync or site build failed, or the post is being filtered by your site generatorSolution:
- Check the commit exists in your repository (the publish status in ChatFeatured links the file path)
- Check your CMS’s build status and logs for errors
- Hugo hides future-dated posts by default — verify the post’s
dateisn’t in the future - If your site uses a
draftfront matter key, confirm your ChatFeatured front matter mapping sets it correctly
Published post links to the wrong URL
Published post links to the wrong URL
Cause: The URL pattern doesn’t match how your site actually routes postsSolution:
- Set URL Pattern in the integration settings to match your live site, including
{slug}where the post slug goes — e.g./blog/{slug}/ - Leave it blank only if your site follows Hugo’s default of mirroring the content path
Featured image referencing the ChatFeatured CDN instead of my repo
Featured image referencing the ChatFeatured CDN instead of my repo
Cause: Image committing is off, or the image download failed at publish timeSolution:
- Turn on “Commit featured images” and set the Image Folder in the integration settings
- Image downloads fail soft — republish the article to retry the image commit
Security Notes
Your GitHub token can write files to your site’s repository. Treat it like a password:- Use a fine-grained token scoped to a single repository with only the Contents permission
- Set an expiration date and rotate the token periodically
- If the blog lives in a shared repository with application code, consider moving it to its own repository before connecting
See Also
- Ghost Integration — API-based publishing for Ghost blogs
- Webflow Integration — CMS with rich field mapping
- REST API — Build custom publishing workflows