Sites & git connections
A site is one org-to-repo connection. How to create one, wire it to GitHub, and keep its working clone in sync.
A site is the unit everything else in Norcube CMS hangs off: one connection from your organisation to one GitHub repository on one branch. Pages, media, schema, discussions, and version history all scope to a site. This page covers the lifecycle of that connection — creating a site, wiring it to GitHub, keeping its clone fresh, and tearing it down.
What a site is
A site stores a connection, not content. The row holds your
organisation, a chosen GitHub installation, a repo (owner/name), and a
branch. The content itself stays in your repo — Norcube never keeps a
content database. The service mints short-lived installation tokens to
read and write on your behalf, and mirrors the branch to a working clone
for fast reads.
One organisation can host as many sites as you like, including several pointed at different repos under the same GitHub account. Sites are listed under CMS in the dashboard and are isolated from each other: schema, media, and permissions never cross between them.
Each site carries:
| Field | What it is |
|---|---|
name | Human-facing label shown across the dashboard. |
slug | URL-safe id (lowercase, digits, dashes). |
provider | Git host. GitHub today (see below). |
repo | owner/name of the connected repository. |
branch | The branch the CMS reads and commits to. |
root | The site folder: where in the repository the site lives. Empty is the repository root. |
installation | Which GitHub App install grants repo access. |
Creating a site
Creating a site is a two-step wizard. Step one commits the site row:
pick a name and a slug. That's all the create form needs —
provider defaults to GitHub and branch defaults to main, both carried
through until you connect a repo.
A freshly created site is in a "pending connection" state. It exists,
but it has no repo yet, so the content endpoints (config, tree, files,
media) return 409 Conflict until you finish step two. The dashboard,
settings, and schema areas still open; they just show "not connected"
until the repo is wired up.
Connecting GitHub
Content access runs through the Norcube CMS GitHub App. Connecting a repo means picking an App installation, a repo that installation can reach, and a branch.
You can only connect a repository that you or your organization can already use:
- a repository another site of your organization is connected to, or
- a repository your own GitHub account can access through an installation of the App, as GitHub answers when you authorize it.
The wizard's step two branches on what you already have:
- Your organization already uses a repository. The CMS lists the repositories your organization's sites are connected to, grouped by GitHub account. Pick one (another site in the same repository, in a different folder, for example), confirm or change the branch (it pre-fills with the repo's default branch), and finish. No redirect to GitHub needed.
- Another repository. Click Use another repository (or Authorize GitHub to list my installations when the list is empty). GitHub asks you to authorize the Norcube CMS App, then the CMS lists every installation of the App your GitHub account can reach, with the repositories you can access through each. Pick one within 30 minutes; after that, authorize again.
- No installation yet. Click Connect GitHub. You're sent to github.com to install the App and choose which repos it can access, then on to the same authorization, and back to the CMS to pick a repo and branch.
Norcube uses your GitHub authorization once, to read which installations and repositories you can access, and never stores it. What it keeps is the list of those repositories, for 30 minutes, for you only: a colleague in the same organization authorizes with their own GitHub account. Once a site is connected to a repository, everyone in your organization who can edit sites can connect another site to it.
A site in a folder of the repository
A repository can hold more than the site: a monorepo with backend/,
frontend/ and website/, for example. Then the site lives in a
site folder, and Norcube CMS works inside it:
- the schema is read from
<folder>/.norcube/cms/, and every path in it (pagesDir,publicDir, collectionpaths, storagepaths, the redirects file) is relative to the folder:pagesDir: src/content/pages, notwebsite/src/content/pages; - the file browser, media, search, content health and page history show the folder's files, with paths relative to it;
- commits only ever change files in the folder;
- the live preview installs the site's packages and runs its dev server in the folder (see Live preview);
- a push that changes nothing in the folder (a backend change) does not refresh the site.
When you pick a repository and branch, the connect page lists the folders
that hold a site: every folder at most two levels deep with a
.norcube/cms/config.yml (or the older norcube-cms.config.yml). The
repository root comes first when it holds one; otherwise the folder that
does is preselected. You can also type another folder, for a site whose
schema you haven't added yet.
A folder is a path inside the repository: letters, digits, ., _, -
and /, no leading /, no . or .. parts, at most 200 characters and
8 levels. It must exist on the branch. Anything else is refused.
To move a site to another folder later, open Settings → Repository → Site folder → Change. Publish or discard the site's unpublished changes first (pages, media, translations being prepared): they belong to the folder they were made in, so the change is refused while any is left. Ignored content health issues move with the site; the index, search and health are rebuilt from the new folder. The change is recorded in the audit log as Site folder changed.
Moving an existing site's schema into a folder takes one commit in your
repository (move .norcube/cms into the folder and drop the folder from
every path in it), followed by the folder change in settings.
What the App can access
The Norcube CMS GitHub App requests repository contents (read and
write, so it can read your files and commit edits) and pull_requests.
Both are scoped to the repos you pick when you install it — nothing
else in your account is visible. These permissions are set on the App
registration on GitHub, so the exact grant is what GitHub shows you on
the install screen.
Removing the App
Norcube doesn't uninstall the App for you, not even when you delete a site or close an organization. The installation belongs to your GitHub account and may also serve other sites or other Norcube organizations, so removing it is your decision. Norcube stops using an installation once no site refers to it, but the App keeps its technical access to the repositories you selected until you remove it: in the settings of your GitHub account or GitHub organization, open the list of installed GitHub Apps and uninstall Norcube CMS. That stops access for every site connected through the installation.
Connecting a site later
If you leave the wizard before step two, the site stays in the "pending
connection" state, and you can finish it any time. On the CMS home, its
card shows Connect repository; the site's Settings page has
Connect a GitHub repository under Git connection. Both open the
same repo picker as the wizard, including the GitHub install and the
OAuth fallback, and land on the site's dashboard once it's connected.
Connecting needs cms:UpdateSite on the site.
Changing the repository
A connected site keeps its repository. Its server-side clone, sidecar
metadata, field history and drafts all belong to that repo, so pointing
it at a different repository or branch is refused with 409 Conflict.
Connecting again to the same repo and branch is fine (for example
after reinstalling the GitHub App, which gives the installation a new
id). To edit a different repository, create a new site for it.
The two-step model
Creating the site row and connecting the repo are deliberately separate
calls. The row is created first; the connect call then checks that you
may use the installation and repository (see above; anything else is
refused with 403 before GitHub is asked anything) and that the
installation can still see the repository (400 otherwise) before it
persists the connection. Until the connect call succeeds, content
endpoints answer 409.
The site home
A site opens on its home page, which is built around the site's content health score: how the site is doing and what to do next. Each fact is said in one place.
- Under the title: the site's address, its languages and how many
pages it has in how many content types. Site settings documents
(collections with
area: site) are not counted as pages. View site opens the address set assiteUrlin the schema, in a new tab; without one the button is not shown. - The band: the site health score (0 to 100) in a ring with its
band word (Good, Needs work or Poor) and one sentence that says where
it sits and how many issues there are, such as "87 of 100. Good
starts at 90. 205 issues in all; start with these 5". The ring opens
Content health. On the
right, the last publish: when, by whom and whether with Norcube AI
(shown only to people who may read the site's
audit log,
cms:ListAuditLogs). While the page list is being updated it says "Updating the page list, figures may change"; while a newer check runs, that the score is from the check before. - Do next: up to five things to do, one sentence each with its number and a button: errors in the schema or content and links that lead nowhere first, then changes that can't be published as they are (Changes), then your own changes waiting to be published (with how long they have waited, and which were made with Norcube AI: changes you confirmed there are yours), then other warnings, then the content health issues whose fixing adds the most points to the score (each row says its area and the points); an issue that stands on fields guessed from their names never leads. Each row has one button, named for what happens: Fix 3 errors, Review 69 pages, Fix with AI (30) (starts Norcube AI on the first ten, where it is offered), Add English versions (the pages missing that language, when one language is missing), Ask your developer (the schema lines on Content health) or Review and publish. Facts listed for your information (pages hidden from search engines, files no page uses) are never a thing to do. See all 205 in Content health says how many issues are open in all. When nothing is left to do, the band says "Nothing needs your attention" with the score in words, and Do next is left out.
- Your work: your own unpublished changes, each opening in the editor.
- Health by area: correctness, search, accessibility, languages and media, each with its score as a bar; a row opens Content health filtered to that area. An area with nothing to check (a site in one language has no language versions) is left out.
- Languages: each language with its pages and "All pages have it" or "N pages still missing", which opens the pages without that language. Only the collections expected in a language count for it (see Language versions). Left out for a site with no languages.
- Content: pages by content type and language, and the pages that have gone longest without a change.
- Pages published per day, Recent publishes (who published how many pages, and whether through Norcube AI, for people who may read the audit log), Translations in progress, Repository (the connected repository and branch with View on GitHub, the last commit, and when the last push notice arrived) and About this site.
A part that can't be worked out right now says "Not available right now". The home never shows a zero or a score it doesn't know: until the first check of the site has finished it says "Checking your site for the first time".
The checks behind the score run after every change to the repository, not when you open the page, so right after a push the band may say that a newer check is running.
A file that holds text Norcube CMS can't store (such as a NUL byte, or text that is not UTF-8) is still listed, but its page may be missing from search or show a cleaned title; the file itself is unchanged. Do next and Content health say how many files "could not be read fully".
When your repo has no .norcube/cms/ schema yet, the home shows no
score: it says so and shows the first steps, with a Generate schema
button that kicks off the AI scaffold (see
AI schema generation).
Errors and broken links
What used to be the Problems page is now the Correctness area of Content health: errors and warnings in the schema and content by file, each with Fix at the field, and links, files and references that point at nothing. The number beside Content health in the site's menu counts the errors plus the broken links; warnings are not in it. Old links to Problems open Content health on the correctness rows.
Keeping the clone in sync
The CMS mirrors your branch to a server-side working clone. Reads (tree listings, file opens, search) hit that local disk instead of GitHub's API, which is what makes them fast. Writes still go through GitHub's APIs and commit straight to your branch.
The clone refreshes two ways:
- Automatically, on push. The App's push webhook fires whenever a
commit lands on a connected branch (whether from the CMS, from your
own
git push, or from a merge). The CMS drops its cached config for that repo and branch and pulls the clone so the next read reflects the new tree. A site in a folder is pulled only when the push changed a file in that folder (or when GitHub's notice can't tell, such as a force push); its next save fetches the branch first either way. - On demand. Sync now under Settings › Repository pulls the clone immediately. Use it when a push landed outside Norcube and you want the catch-up now, or on a local/dev setup where the webhook isn't wired. It returns once the pull finishes, then re-reads the config with the cache bypassed so the fresh file isn't masked by a stale cached copy.
The site layout also warms the clone the moment you open a site, so even pages that don't otherwise touch the content tree (dashboard, schema, settings) start the clone early.
Searching the repo
Each site has a repo-wide file search: it walks the whole working clone and returns files whose name matches your query (case-insensitive substring), newest first. You can restrict the walk to a subdirectory, filter by extension, and optionally pull each Markdown file's frontmatter inline so the results can show preview titles. This powers the search box on the Pages list and is distinct from the folder-scoped tree listing.
Site settings
Settings (under Manage in the sidebar) has five sections:
| Section | What's there |
|---|---|
| General | The site's name and slug, its icon and where it comes from, and the pages folder from config.yml (read-only: change it in the repo). |
| Repository | The connected repository and branch with a GitHub link, Connect for a site without one, and Sync now. |
| AI assistant | AI context: the short site description the AI assistant reads before every answer. Edit it, or regenerate it from your pages. |
| Advanced | Only for sites still on the single norcube-cms.config.yml: its raw JSON editor. |
| Danger zone | Delete the site. |
Generating or regenerating the schema is on the Schema page (under Developer), not in Settings.
Renaming, re-slugging, and deleting
Rename / re-slug
Edit a site's name or slug under Settings › General. The slug must stay URL-safe (lowercase letters, digits, and dashes, 1-64 characters, starting and ending with a letter or digit) and unique among the organization's sites. Changing it changes the site's dashboard URLs, so old links and bookmarks stop working. Renaming doesn't touch the repo or the git connection.
Delete
The settings Danger zone permanently removes the site from Norcube. Deleting requires typing the site's slug to confirm, and the card only shows for callers who hold the delete permission.
Delete removes the Norcube connection and all CMS-side state for the site — its collections, pages, media records, drafts, discussions — shuts down its live preview, and wipes the server-side working clone. It does not touch your GitHub repository or its files, and it leaves the GitHub App installed: see Removing the App. If the preview or the clone can't be removed, the delete fails with an error and the site stays, so you can try again. Your content stays exactly where it is in git, so you can reconnect the same repo later as a fresh site.
Members
A site's Members area controls who in your organisation can work on that specific site and what they can do. Access is delegated per site: inviting a member and viewing policies run through Norcube's permissions system rather than the CMS content APIs. See Permissions for the roles and capabilities.
What's not there yet
- GitHub only.
gitlabis reserved as a provider name, but no GitLab adapter ships today — the install, OAuth, and connect paths all reject anything that isn't GitHub. GitLab and other hosts are follow-on work. - No in-place branch switching. You choose the branch when you connect the repo. There's no settings control to repoint an existing site at a different branch yet.
- Installation lifecycle is partial. If you remove the App from a repo on GitHub, the CMS drops its cache for the affected repos, but a site still pointing at a removed installation isn't automatically marked disconnected yet.