Content Sources

GitHub

Publish Markdown files from a public or private GitHub repository, a folder of one, or a single file.

Contito reads Markdown (.md and .mdx files) from GitHub repositories, public or private.

These docs are published this way: Markdown files in a private GitHub repository, one folder per category.

In the repositoryOn your site
FolderCollection (a group of articles)
.md or .mdx fileContent (one article)
index.md, README.md or _index.mdThe collection's own page
Images and other filesNot articles. Images show where a page uses them

The seo-playbook repository on the left and the Contito collection it becomes on the right

Public or private

Public repositoryPrivate repository
SetupNone. Paste the addressOnce: connect GitHub and install the Contito app
Syncs asContitoThe person who added it

A single private file needs the same setup as a whole repository. GitHub grants access per repository, not per file.

On GitHub, Contito's app is called Contito App. That is the name GitHub shows when it asks you to authorize or install it.

Connect a repository or folder

  1. Open your site's Collections page, or the collection that should hold the files.
  2. Click + next to Collections.
  3. Set Collection Source to GitHub Repo.
  4. Paste the address into Source ID.
  5. Click Save.

The Add Collection dialog with GitHub Repo picked, the demo repository's address pasted, and Save marked

#What it does
1Collection Source: GitHub Repo.
2Source ID: the repository or folder address.
3Save: creates the collection and starts the first sync.

A private repository that isn't set up yet opens the setup panel instead, described below.

What you paste decides what syncs:

PasteSyncs
https://github.com/owner/repoThe whole repository, from its default branch
https://github.com/owner/repo/tree/main/docsOnly the docs folder
https://github.com/owner/repo/tree/v2The whole repository, from the v2 branch

To get a folder's address, open the folder on GitHub and copy the address from the browser.

To try it, paste our demo repository: https://github.com/kytokev/seo-playbook.

Connect a single file

For one article, open a collection, click + next to Contents, and set Content Source to GitHub File.

Paste the file's address, which has /blob/ in it:

text
https://github.com/kytokev/seo-playbook/blob/main/02-on-page-basics.md

Set up a private repository

Contito asks for setup the first time it can't see a repository.

The setup panel replaces the dialog's form and asks: "Contito can't see this repository. Is it private or public?"

The setup panel for a private GitHub repository with three steps: Connect your GitHub account, Install Contito, Give Contito access

Pick Private, then follow the three steps.

Each finished step shows a check, and only the current one has a button.

StepButtonWhat happens on GitHub
1. Connect your GitHub accountConnect GitHubYou authorize Contito App
2. Install Contito on the ownerInstall on GitHubYou pick the account or organization and its repositories, then click Install
3. Give Contito access to the repositoryChoose repositoriesYou add the repository to the ones Contito may read

GitHub shows these screens in its own window:

GitHub's Authorize Contito App screen, with the Authorize button marked

#What it does
1Authorize: lets Contito App know who you are on GitHub. It reads no repository yet.

GitHub's Install Contito App screen, asking where to install it: a personal account and two organizations

#What it does
1Where to install: your personal account, or the organization that owns the repository.

GitHub's install screen with Only select repositories picked, one repository chosen, Read access to code and metadata, and Install

#What it does
1Only select repositories: Contito reads only the repositories you pick.
2The repository to publish from. Add more with Select repositories.
3Read access to code and metadata: the only permission Contito asks for.
4Install: finishes on GitHub and returns you to Contito.

Each button opens a GitHub window.

When it closes, or when you come back to the Contito tab, the panel checks again and moves on by itself. Check access checks right away.

When all three steps show a check, click Connect source.

The source is added with what you already entered, so there is no need to click Save again.

Cancel returns to the form with everything you typed.

Public, or a typo

GitHub answers the same way for a private repository and for a wrong link.

Pick Public, and the panel shows the link with "Make sure the link is valid". Click Cancel and fix the address.

Organizations

For a repository owned by a GitHub organization, install the app on the organization, not on your personal account.

  • Only an owner of the organization can install it. A member's install becomes a request, which an owner approves in the organization's settings.
  • Once approved, click Check access in the setup panel, or add the source again.
  • One installation serves the whole team. Any teammate who can read the repository on GitHub connects their own GitHub account and adds sources from it.

Connected Accounts

You can also connect GitHub before adding any source.

Open the app menu, click Account, and find GitHub under Connected Accounts.

The GitHub row under Connected Accounts, showing the GitHub username and the Manage repositories and Disconnect GitHub buttons

ButtonWhat it does
ConnectAuthorizes Contito on GitHub, then continues to the install page if the app isn't installed yet
Choose repositories or Manage repositories (folder icon)Opens GitHub's page for the app, to add or remove repositories
Disconnect GitHub (plug icon)Asks first, then disconnects. Private sources stop syncing; public ones keep syncing

Connecting GitHub never signs you in to Contito. It only lets Contito read your repositories.

Folder pages

A folder's index.md, README.md or _index.md is the collection's own page, its introduction.

It is not listed as a separate article.

A folder holding only that one file becomes a single article.

In the demo repository, README.md is the page of the SEO Playbook collection, and technical-seo/index.md names its collection Technical SEO.

Order, titles and addresses

Files are added in alphabetical order of their paths.

Number your files to set the order, and give each one a real title in its front matter:

markdown
---
title: Keyword Research
description: Find the words your customers type into Google.
---

01-keyword-research.md then shows as Keyword Research, first in its collection, with an address ending in /keyword-research.

Without a title, a single # Heading at the top of the file is used, then the file name.

Files added later go to the end of their collection. Drag them in Contito to reorder; syncs keep your order.

A folder without an index file keeps its folder name, such as content-strategy. Add an index.md with a title to name it.

Front matter

FieldKeys read
Titletitle
Descriptiondescription, summary, excerpt
Cover imagecoverImage, cover, image, thumbnail
Tagstags, keywords
Authorsauthors, author
Datedate, publishedAt, published, updatedAt

Dates come from front matter only, never from Git history.

  • Relative image paths work: ![Search result](./images/search-result.png). Contito copies the image to your site, so it shows even when the repository is private.
  • Links to other Markdown files in the repository work too: [Keyword Research](./01-keyword-research.md) opens that article on your site.
  • .mdx files are read as Markdown. Imports and code expressions are not supported; the components in Writing in Markdown are.

Keeping it in sync

Push to GitHub, and the site follows on the next sync.

Starter syncs once a day, Pro and Ultimate every hour, and Sync in the collection's menu syncs right away. See Syncing .

A deleted file disappears from the site on the next sync. Synced articles are edited on GitHub, not in Contito.

Who a private source syncs as

A private source syncs with the GitHub access of the person who added it, even when nobody is signed in.

If that person disconnects GitHub or loses access to the repository, the source stops syncing until it's fixed.

If they leave your team, a teammate connects their own GitHub account and adds the source again.

Troubleshooting

MessageFix
"Contito can't see owner/repo. Check that the Contito app is installed on owner with access to this repository…"The app was uninstalled or the repository removed from it. Add it back with Manage repositories, then Sync
"Contito can no longer read this private repository. Connect GitHub again in Account Details, then sync."The person who added it disconnected GitHub. Connect again, then Sync. No need to add the source again
"Contito can't find owner/repo on GitHub. If it is private, connect GitHub in Account Details…"Shown to AI agents. Check the link; if the repository is private, do the setup once
"Expected a link to a Markdown file (.md / .mdx)"A GitHub File needs a /blob/branch/file.md link. Use GitHub Repo for a folder
"GitHub: API rate limit exceeded, try again later"Wait a few minutes, then Sync
The install shows "request sent"You aren't an owner of the organization. Ask an owner to approve it

Limits

  • Branch names with a /, such as feature/docs, don't work in addresses.
  • Very large repositories, around 100,000 files, may not be read completely.
  • Links between files work within the same repository only.

FAQ

Why a GitHub App instead of "Sign in with GitHub"?

To read private repositories, a "Sign in with GitHub" app must ask for full control of every private repository you can reach, read and write, across all your organizations.

Contito App reads only the repositories you pick, and nothing else. GitHub recommends apps like it for integrations.

Can Contito change my code?

No. Contito App asks for read access to repository contents only.

It can't push commits, edit files, open pull requests or issues, or change settings.

Does Contito see my whole repository?

GitHub grants access to the whole selected repository, and Contito reads only the files your sources use.

To share one file without the rest, keep it in a repository of its own.

How do I remove Contito's access?

Click Disconnect GitHub in Account, or on GitHub go to Settings > Applications > Authorized GitHub Apps > Contito App.

To narrow which repositories it reads: Settings > Applications > Installed GitHub Apps > Contito App > Configure. For an organization, use the organization's Settings > GitHub Apps.

Does publishing make my private repository public?

No. The repository stays private on GitHub.

The articles are as visible as your site is, so publish only what may be read there.

Can an AI agent add a private repository?

Yes, once you've done the setup. An agent can't click through GitHub for you, so the first time it passes on the setup message. After that it adds sources from that repository on its own.