Publishing to Astro, Hugo and Next.js from Content Studio
Content Studio publishes to Astro and other static sites by adding each article to your GitHub repo as a Markdown file, shaped like the posts you already have. Connect a repo once and articles arrive as pull requests or commits, by hand or on their calendar day.
Key takeaways
- You connect with a fine-grained GitHub token limited to one repo, with Contents and Pull requests set to Read and write, pasted once in Settings, Publish Controls.
- Content Studio spots Astro, Hugo, Next.js, Jekyll and Eleventy from their config files, and copies the frontmatter keys, date style and image folder of a recent post.
- Each send is one commit holding the post and its images, as a pull request on a branch named answer-socrates/<slug> or straight to your branch.
- Sending the same article again updates the same file, and replaces any edits made in the repo since the last send.
- Scheduled articles can go out by themselves: "A pull request" opens one on the day, "A commit (live)" commits to your branch, and failed sends are retried every hour.
Content Studio publishes to static sites through GitHub
A static site is a website built from files in a code repository (a repo: the folder of files GitHub stores for a project). Astro, Hugo, Next.js, Jekyll and Eleventy all work this way. A blog post is a Markdown file, and a host such as Netlify, Vercel or Cloudflare Pages rebuilds the site each time the repo changes.
There is no admin screen to post into, so Content Studio does what a developer would do: it adds the post to your repo as a Markdown file. GitHub's API lets us write the post and its images in a single commit, without copying your code anywhere.
Frontmatter is the block between the two --- lines at the top of a Markdown post. It holds the title, date, image and anything else your theme reads. Your site decides which keys must be there.
That last point is why this matters. Astro checks every post against a schema (a list of required fields and their types) when it builds [1]. A post with a missing or misnamed field fails the build, and your site does not update. Content Studio guards against that by copying the keys from a post you already have.
Make a GitHub token for one repo
Content Studio signs in to GitHub with a fine-grained personal access token. That is a password-like key that GitHub limits to the repos and permissions you pick [3]. You make it on GitHub, paste it once, and can revoke it at any time without touching your own login.
- In Content Studio, open Settings, then Publish Controls, and press Connect on the GitHub tile.
- Follow the link to GitHub's new fine-grained token page.
- Under Repository access, choose Only select repositories and pick your site's repo.
- Under Permissions, set Contents and Pull requests to Read and write. Generate the token and copy it.
- Paste it into Fine-grained token and press Check token.

GitHub sets a 30-day expiry by default unless you pick another [3]. When the token expires, sends fail with "GitHub didn't accept that token", and Replace token in the same drawer fixes it.
Pick the repo, branch and posts folder
Once the token checks out, you choose where posts go. Content Studio lists the repos the token can see, the branch to work from, and up to eight folders that already hold two or more Markdown files.
If your posts folder is new or empty, pick Another folder and type the path. With no posts to copy, you get the standard post shape for your site type instead.
Next comes the preview. Content Studio reads a recent post (the newest of the last few files in the folder) and shows what a new one will look like: the site type, the file format, where images go and which keys it copied.
Check the copied keys against your site's schema. Keys that belong to one post only, such as an id, permalink or canonical URL, are left out, and so is the image key when an article has no featured image. If your schema requires any of those, the build can fail, so open the first pull request's preview before you merge. The format is saved when you connect: if you change how your posts look later, use Change repo or folder to read it again. The last step asks what happens when you press Publish, which the next sections cover.

Your recent posts set the format
Every site generator has its own habits. Content Studio spots which one you use from its config file, then follows that generator's rules on top of what it copied from your post.
| Site generator | How we spot it | What we follow |
|---|---|---|
| Astro | astro.config file | Content collection keys, relative image paths, folder posts (my-post/index.md) |
| Hugo | hugo.toml, or a content folder with config.toml | Page bundles, the static folder for images |
| Next.js | next.config file | .md or .mdx posts [2], matching the files already in your folder, images in public |
| Jekyll | _config.yml | Dated file names such as 2026-11-23-cold-brew-ratio.md |
| Eleventy | its eleventy config file | Markdown posts in your folder |
| Anything else | no known config | The shape of your newest post |
A made-up example: a coffee roaster runs an Astro blog with posts in src/content/blog. Its newest post has title, description, pubDate as a quoted date and heroImage pointing at ../../assets/. A new article about cold brew ratios arrives with the same four keys, the date quoted the same way, and its hero image committed into src/assets so the relative path works.
Jekyll needs the date in the file name, and Content Studio adds it [4]. Hugo's page bundles keep a post and its images together in one folder [5]. If your newest post is a bundle, new posts are written as my-post/index.md with the images beside them.
Send an article as a pull request or a commit
Open any finished article and press Publish (in Content History, it is the button in the Live column). If you have more than one destination connected, pick GitHub.

The two choices map to how most static sites go live.
| Choose | What happens | Best for |
|---|---|---|
| Pull request | A new branch named answer-socrates/<slug> and a pull request into your branch. Most hosts build a preview link for it. | Your first sends, client sites, any repo where someone reviews changes |
| Commit to your branch | The post is committed straight to the branch you picked. | Sites you trust the drafts on, once the format is proven |
Here is the pull request from one real send, an article called "Will AI Search Replace Google in 2026?".

After the first send, the button on that article reads Update (or Update on GitHub). Press it and Content Studio updates the same file. If the pull request is still open, the new version lands on the same branch. If you already merged it, a new pull request carries the update.
Publish on autopilot with the content calendar
Content Studio can write and send articles by themselves. Put articles on the Content Schedule, switch on automatic writing in Settings, under Content & SEO, and each one is written on its calendar day.
To send them too, go to Publish Controls, find Scheduled articles, set Send to to GitHub, then choose how in As:
- A pull request opens one on the article's day, ready for you to merge.
- A commit (live) commits it to your branch, so it goes live once your host rebuilds.
- Don't send (the default) leaves scheduled articles for you to publish by hand.
Articles you already sent to GitHub by hand are left alone. If a send fails, the article shows the error and Content Studio tries again every hour.
The same thing in Ask Socrates
Ask Socrates, the chat in Answer Socrates, can plan and write an article with you, and the article lands in Content Studio. From the chat you can send it to WordPress, but not to GitHub yet.
So for a static site, write it in the chat, open the article from Content History, and press Publish there. Everything above applies from that point on.
When a send fails
Content Studio shows GitHub's problem in plain words. These are the messages you are most likely to see.
| Message | What it means | Fix |
|---|---|---|
| That token isn't allowed to do this | The token can read the repo but not write to it | On GitHub, set Contents and Pull requests to Read and write, save, and send again |
| GitHub couldn't find that repo or branch | The token was not given this repo, or the branch was renamed | Add the repo to the token, or use Change repo or folder |
| GitHub didn't accept that token | It expired or was deleted | Make a new one and use Replace token |
| That repo is empty | There is no first commit to build on | Push any first commit, then send again |
| GitHub is rate limiting this token | Too many requests in a short time | Wait a few minutes and try again |
A fine-grained token is also the safe choice. It can only touch the repos you gave it, and Content Studio only writes posts and images in the folders you picked. Revoking the token on GitHub cuts access at once, without changing your password.
Where to go next
| If you want to... | Read |
|---|---|
| Write the article before you send it | Writing with Content Studio, step by step |
| Send to a WordPress site instead | Publishing to WordPress from Content Studio |
| Decide what to write first | From cluster to content plan: what to write first |
| Link new posts to your other pages | Internal links: connecting your pages |
Sources
- Content collections, Astro Docs, n.d.
- Using MDX with Next.js, Next.js Docs, n.d.
- Managing your personal access tokens, GitHub Docs, n.d.
- Posts, Jekyll Docs, n.d.
- Page bundles, Hugo Documentation, n.d.
- Front matter, Hugo Documentation, n.d.
