Skip to main content
AI Visibility4 min read

Publish Cituna articles to a GitHub repo (Astro, Hugo, Jekyll, Eleventy)

Have Cituna commit each finished article as Markdown with YAML frontmatter, so your static site build turns it into a page. Token scopes, base folder, and the one check to run first.

Updated

If your site builds from Markdown files in a repository, the cleanest place for an AI-written article is the same folder your other posts live in. Cituna commits `your-base-folder/slug.md` with YAML frontmatter, your existing build turns it into a page, and the article goes through whatever review your repo already has: a pull request, a preview deploy, a branch protection rule. Nothing new is introduced into your pipeline. This is the destination for Astro, Hugo, Jekyll, Eleventy, and for Next.js sites that read posts from a content directory. It is emphatically not the destination for a site that serves articles from a database, and the next section explains why that failure is silent.

What this assumes

Your site BUILDS FROM MARKDOWN FILES in a repo. Cituna commits a .md file and your build turns it into a page. If your site serves articles from a database or a CMS instead, the commit will succeed, Cituna will report the article as published, and the page will never appear anywhere. Use the webhook destination for those stacks.

1. Check where your posts actually live

Open any existing post in the repo and note its path. If your posts live at `src/content/blog/hello.md`, your base folder is `src/content/blog`. Get this from a real file rather than from memory: a plausible-but-wrong folder is the difference between a page and a file nobody reads.

Also check what frontmatter your build requires. Cituna writes title, description, stable publication date, modified date, canonical URL, slug and tags; if your theme demands another field, add a default in your build config before connecting.

2. Create a fine-grained personal access token

On GitHub, go to Settings → Developer settings → Personal access tokens → Fine-grained tokens. Scope the token to the single repository you want, and give it Contents: Read and write. That is the only permission needed.

Classic tokens are refused. A classic token can reach every repository you own, and no publishing integration needs that.

3. Connect the repo in Cituna

Open Integrations → GitHub and paste the token and the repository as owner/name. Set the branch your site builds from, usually main, the base folder you found in step one, and the public article URL prefix, such as https://example.com/blog. The prefix is how Cituna writes the canonical and links later articles to the public page instead of to GitHub.

Publishing credentials are per brand, so switch to the right brand first if your workspace tracks more than one.

4. Let the write test prove the path

Connecting checks the token, the repository, its write permission and the branch, and writes nothing to the repo. Once it is saved, press Test write on the GitHub card: Cituna commits a small test file to your base folder and then deletes it, so you know the token, the branch and the folder all work before a single article is written.

If the check or the test fails, the message says what GitHub refused.

5. Turn on the daily article

Open AutoSEO and pick the GitHub tile in step 1 ("Where should the articles go?"). Step 2 offers two answers for a repository: review each one in Cituna before its commit, or commit automatically. There is no third, because a repository has no draft state and your own build decides when a committed file becomes live. Then switch on "Write articles every day" in step 3.

If you want review before publication, use a branch your site does not build from, and merge when you are happy.

Troubleshooting

Cituna says committed but nothing appears on my site.

Two causes. Either your site does not build from files at all, in which case switch to the webhook destination, or the base folder is not the one your build reads. Open the commit on GitHub and compare its path against an existing post that does render.

What happens if I edit an article after it was committed?

Editing in Cituna and pressing Update on GitHub commits over the same file. The slug is fixed at the first commit and never re-derived from an edited title, precisely so a retitled article updates its file instead of orphaning it and committing a second one.

My token was rejected even though I just made it.

Fine-grained tokens on an organisation repository often need an admin to approve them before they work, and they carry an expiry date that is easy to set to seven days by accident. Check both on the token page.

Can Cituna open a pull request instead of committing directly?

Not today; it commits to the branch you configure. The equivalent is to point Cituna at a branch your site does not build from and open the PR yourself, which keeps your existing review process in charge.

Drafted with AI assistance from our own research and Search Console data, and reviewed by Rahul A before publishing. Rules and prices change; check the linked official source before you act.

Find your next AI visibility fix with Cituna

Cituna asks ChatGPT, Perplexity, Gemini, Claude, Grok, Google AI Overviews and Google AI Mode your buyers' questions every day, writes the fix for every answer you are missing from, and publishes new articles to your site. Run all of it from Claude or any AI agent.

Start free trial

3-day free trial · Card required, cancel anytime · Plans from $39 a month

Check crawler readiness free