Keeping a Website in Step With GitHub

Our Commitment

MountDev Ops is built security first. Your business data belongs to you, and you can export all of it at any time. We never use analytics or tracking of any kind inside MountDev Ops.

!The Sources page where a website follows files in GitHub.

!The Sources page where a website follows files in GitHub, in dark mode.

!The Sources page where a website follows files in GitHub, on a phone.

!The Sources page where a website follows files in GitHub, on a phone in dark mode.

What It Does

A website's Sources page keeps its pages in step with files in your own GitHub repository. Say which folder or file becomes pages, posts, or docs, see what would change, and press Sync Now. Every page it makes is a draft that waits for a person to publish it. Nothing goes live by itself, and nothing in GitHub is ever changed.

Sources is the plain way to do it. If you want your own steps (read a file, then do something with it), a workflow can do the same job: see Saving Website Pages From a Repository.

Connect GitHub

Sources reads your repository through your own GitHub connection. An owner or admin adds it in Settings, then Connections, then Connected Services, then Connect a Service, then GitHub, with a read only key for only the repositories you choose (see Reading GitHub From a Workflow). Sources uses that same connection, and the key is never shown again.

Add a Source and Its Mappings

Choose Add a Source on a website's Sources page (action sites.source.save). A website can have up to 10 sources. A source is one repository (from the ones your connection lists) and one branch, such as main, with up to 100 mappings. A new source is turned off and has no mappings yet: choose Choose Folders on its card to pick folders from a tree of your repository (see Choose Folders From the Repository below), or Add One to type a single path. What bounds a sync is the number of files it reads (500), not the number of mappings.

Each mapping is one row in the card's Mappings group. Line one is its path in bold (a folder ends with a slash) and what it becomes, such as "Docs under /docs/", "Pages under /handbook/", or "Collection features". Line two is its address folder, whether pictures are on, and how many files its last sync read. On the right is one chip, Keep as a Draft or Publishes Automatically, with Edit and More (Remove Mapping). Edit opens a pop up with four groups of fields, and a live line under What It Makes that shows where a file would go, such as "handbook/hours.md becomes /handbook/hours". Remove Mapping is at the left of its footer and asks first; a removed mapping is hidden and kept.

A mapping has:

  • Path (Where). A folder (such as docs) or one file (such as about.md) in the repository. Leave it empty for the whole repository. Only Markdown and HTML files are read.
  • Address folder (Where). An optional folder the pages go under. A mapping of handbook with the address folder handbook makes handbook/hours.md the page /handbook/hours. A file's own front matter address is used exactly as written.
  • Becomes (What It Makes). Pages, or a Collection (see Collections From GitHub below). Data values come in a later update.
  • Address Comes From (What It Makes, a Collection from a data file only). The field of each item that gives its address, such as slug or id. Empty means address, as before. See Collections From GitHub below.
  • Kind (What It Makes). Page, post, or doc. This is the default address the files follow: a doc lives under /docs/, a post under /blog/, and a page at its own address.
  • When It Goes Live. Keep as a Draft (the start) or Publish Automatically, set for this mapping alone (see Publish Automatically below).
  • Bring In Pictures the Files Point At (Pictures). On for a new mapping (see Pictures From GitHub below). A mapping made before this keeps it off until a person turns it on, so nothing changes by itself.

A file docs/start.md in a mapping of docs with kind doc is the doc /docs/start. A file named index.md is its folder's own page. The same rules as the workflow steps apply: the title comes from the file's front matter or its first heading, Markdown becomes the website's own blocks, HTML is cleaned the same way as a custom section, and an address can use only lower case letters, digits, dashes, and slashes.

Several mappings in one source, and several sources on one website, are how you set up different groups: docs, a handbook, and posts each get their own folder and kind. Two mappings cannot use the same path.

Saving a mapping makes the next sync read every file again.

Choose Folders From the Repository

Choose Folders (on the Mappings group, and the first thing an empty source shows) opens a pop up with your branch's folders as a tree (action sites.source.tree, for people who can build websites). It reads your repository with your own GitHub key, once for the pop up, and keeps nothing.

  • The tree. Each folder is a row with an arrow to open it, a checkbox, its name, and how many files a sync can read in it ("12 files"). Folders open one at a time, so a large repository opens at once. Only Markdown, HTML, and data (.json) files count. A folder with nothing readable in it is greyed and says "Nothing to read". Find a Folder (2 characters or more) opens the tree to the folders that match.
  • Ticking. Tick as many folders as you like. A ticked folder is read with everything inside it, so its subfolders show Included and cannot be ticked on their own. Ticking a folder that already contains ticked ones asks "Use this one folder instead of the 3 inside it?" in the pop up. A folder that already has a mapping shows Mapped, and one a source's Never Map list keeps out shows Never Mapped, with Map It to take its name off the list (it asks first). A mapping whose folder is no longer in the repository shows Folder Not Found.
  • For Every Folder Ticked. One set of choices for all of them: Becomes (Pages or A Collection), Kind, Address Folder (The Folder's Own Name, such as handbook for the folder handbook, None, or one folder you type), and Bring In Pictures. Your Choices lists each ticked folder with what it will become. Edit on a row changes that folder alone and marks it Own Choices; a later change to the defaults never touches a row with Own Choices.
  • Always drafts. Every folder ticked here is kept as a draft. Publish Automatically is never part of ticking many folders: choose it later, on one mapping at a time, in its Edit pop up, as a person who can publish a website.
  • The limit. The footer shows the files read against the 500 a sync reads ("342 of 500 files"). Ticks that would pass 500 are refused before saving, with how many folders to untick, and a source holds up to 100 mappings.
  • Type a Path Instead is always at the bottom, for a path that is not in the tree, a repository too large for one tree, or anyone who prefers typing. A tree that cannot be read says why in plain words, with Try Again.
  • Data files. A .json file shows Data File and Use as a Collection, which opens the four step guide (see Collections From GitHub below).

Pop ups work with the Tab key and Esc: Skip to Your Choices is the first control and Find a Folder the second. Esc and the close buttons ask first when you have ticked folders you have not saved. While a sync runs, the open pop up is never drawn again; if the source was saved by someone else, a line offers Reload Choices and nothing moves until you press it.

Preview Pages

Preview Pages (action sites.source.plan, for people who can build websites) is in the Choose Folders pop up, the Edit pop up of a mapping, and the last step of the data file guide. It shows what the choices as they now stand would make, before anything is saved, and writes nothing: no page, no run, no note, no kept file. It shows a counts line ("84 pages: 80 new, 3 the same as now, 1 would be refused") and the first 25 pages, each with its address, title, kind, and New, Changed, Same, or Refused, with the reason for a refusal: an address another file already makes, an address a page made by hand holds, or letters that cannot be used. It reads at most 25 files from GitHub, so it answers in a moment. Not Read Here counts the files beyond the first 25 and lists their addresses worked out from the file name, which is marked because their titles and any address in their front matter were not read. A choice that would read more than 500 files says so. It also lists Gone From GitHub, the pages whose files are no longer on the branch (a sync would mark them and leave them as they are), and says in words why a mapping reads nothing. The full See What Would Change on the card stays as it was. Taking a mapping away hides it and keeps it, and the pages it made stay exactly as they are.

Never Map

A source has a Never Map list in its Change Source pop up: folder or file names, such as node_modules, .github, or drafts, added and removed one at a time, up to 100 for a source. A file whose path has a folder or file with one of these names anywhere in it is never read by the source, however it is mapped, and the pictures it points at are not brought in either. Names only: there are no patterns or wildcards, and a name is one folder or file name with no slash.

A new source starts with .github, node_modules, vendor, dist, and build on its list. They are a start, not a rule: remove any of them. A source made before this has an empty list until a person adds names.

A sync lists each file the list kept out as Skipped, with the reason "On the Never Map list", so it is never a mystery (the first 100 one by one, then one line for the rest). It is a skip, not a removal: a page already made from a file that is now on the list stays exactly as it is, and the sync never says the file was removed from GitHub. Changing the list makes the next sync look at the branch again. The list is part of the sites.source.save action as never.

Pictures From GitHub

A Markdown or HTML file in a mapped folder can point at pictures in the same repository by a relative path, such as ![The Sources page](media/sources.png) or <img src="../images/flow.png" alt="A flow">. With Bring In Pictures the Files Point At on, a sync does this for each picture a file points at:

  • It finds the picture. The path is worked out from the file's own folder and must stay inside the repository (.. may go up, never out). An address that starts with http, //, or data:, a path through a symbolic link, and a path that is not there are left out, with the reason in the changes list.
  • It checks it like an upload. A PNG, JPEG, WebP, or GIF only, up to 5 MB and 50 megapixels. The type is read from the file's first bytes, never its name, so a script named .jpg and every SVG are refused (an SVG picture can carry code).
  • It keeps it with the website's pictures. The picture is stored in Files, encrypted like any file, in the website's own subfolder of the Websites folder (the same folder the Pictures page uses), and added to the website's pictures. The same picture used by two pages is stored once.
  • It rewrites the reference. A Markdown picture becomes an image block where it stood in the text, with the description you wrote. An HTML picture keeps only its own address on the website and its description. The page never points at GitHub.
  • It remembers where it came from. A picture shows From GitHub with its file and the commit it came in at, on the Pictures list (pictures brought in before this change stay in their old folder until Review Your Files moves them), and a managed page lists its pictures.

A picture with no description is left out, and the page still syncs. Add a description in your file, such as ![The Sources page](media/sources.png), so people who cannot see it know what it shows. A picture nothing points at is never read, and a script, stylesheet, font, PDF, or video is never brought in, even when a file points at it.

Pictures follow the rules of pages. A new or changed picture changes the page that shows it, so the page waits in the website's list of changes as a draft. A changed picture comes in as a new picture, and the earlier one stays stored. A picture file removed from GitHub keeps the picture and the page exactly as they are, and the people who manage Websites are told once. A sync never deletes a picture.

Limits: a picture is up to 5 MB and 50 megapixels, one sync brings in up to 100 pictures (a larger first sync is refused with the count, and you choose a smaller folder), a page shows up to 50, a website holds up to 2,000, and a repository can hold up to 5,000 picture files while a mapping brings pictures in.

Pictures Come In As Private or Public

In Change Source, Pictures From This Source chooses how the pictures a sync brings in from now on come in: Private (the start, only signed in people of your company) or Public (anyone with the picture's address can load it, with no sign in). Choose Public for docs and website pictures that are meant to be seen by everyone, so you do not have to change each one by hand.

  • It applies when a picture is first stored. A picture that changes in GitHub is stored as a new picture, so it follows the choice again. The same picture already on the website keeps the visibility it has.
  • A sync never changes a picture that already exists. A picture you made Private or Public yourself stays exactly as you set it.
  • Change the pictures already brought in. Tick Also change the pictures already brought in when you save. It changes the pictures the sync itself brought in, a few at a time, and leaves every picture you changed yourself. The box shows how many it will change and how many it will leave.
  • Only an owner or admin chooses Public. Anyone who may edit the source can choose Private. Choosing Public asks first, and turning a picture Private later ends its public address for good.
  • It never stops a sync. If Public cannot be made (Public files are turned off in Files, Settings, the account is closed, the person who chose Public is no longer an owner or admin, or the address could not be made), the picture comes in Private and What Changed says why.

Collections From GitHub

A mapping can become a Collection instead of pages: a named list of items, such as features or apps, each item also a page. Choose A Collection on a mapping and fill in:

  • Collection Name. Lower case letters, digits, and dashes, such as features.
  • Page Template. One of your page templates (Page Templates). Each item fills it: a {{name}} anywhere in the template's text is replaced by that item's own detail of that name, such as {{title}} or {{summary}}. A picture block left with no picture is the template's picture slot, filled by the item's picture.
  • Only Items Where and Has One of These Values. An optional filter on one detail, such as status is Built, Live. Items that do not match are not made and are counted as not changed.
  • List In File. For a data file only: where the list is inside the file, up to 3 names deep, such as areas or areas.pages.
  • Address Comes From. For a data file only: the field of each item that gives its address. It starts as address. Choose any one text field, such as slug or id, that every item has. The server reads that field the way it reads address: under the mapping's address folder, with lower case letters, digits, dashes, and slashes only. An item without it, or with letters that cannot be used, is skipped with the reason and the field's name in it.

What an item is:

  • A folder of Markdown files. Each file is one item. Every front matter key is a detail of the item, and the text under the front matter is its body. Its address follows the same rule as a page (the folder and the file name, or an address in the front matter, under the mapping's address folder). The list is in order by an order number in the front matter, then by file name.
  • **A data file (.json).** Each entry of the list is one item. An entry that is a plain word, such as websites, is an item named that, with that as its address. An entry above the list lends its name and its other short details to each item below it: in areas, each with a name and a list of pages, every page has the detail area, and area_note for another detail of the area. An item needs a field for its address: address unless Address Comes From names another. Nothing is guessed.
  • A picture. An item can name picture (a path in the repository) and picture_alt (its description). It comes in the way a page's pictures do (see Pictures From GitHub). An item whose picture is missing, refused, or has no description is still made, without the picture.

An item missing a detail its template needs, with no address, or with an address that uses other letters is skipped with the reason. Pages follow the rules of pages: drafts until a person publishes (or published automatically by a mapping that is set to), a page made by hand is never changed, and a file or item removed from GitHub leaves its page exactly as it is and tells the people who manage Websites. A collection holds up to 500 items. A data file can be up to 800,000 characters (Markdown and HTML files stay at 200,000).

The guided setup. Use as a Collection in the tree (or Guided Setup for a Data File in a collection's Edit pop up) opens four steps, each showing its answer before asking the next question: 1 File (its path and size, refused on the spot if it is over the limit), 2 List (every list the file holds, with its count and first item, up to 3 names deep, and nothing that is not a list), 3 Items (the first 10 items with the address each would get, and Address Comes From, which suggests address, then slug, then id, and says why a field cannot be used, such as "key has a colon, which an address cannot have"), and 4 Template (the collection name, taken from the file's name and changeable, your page templates with a green or red word for each detail the items have or lack, the filters, and Preview Pages). The pop up only suggests; you choose. The file is read once, for the guide, and nothing is kept.

Show a collection on any page with the Collection List block (see Sections). An assistant can read every collection, with each item's page address and the file it came from, with the websites_collections tool (action sites.collection.list).

See What Would Change

Preview (action sites.source.sync, preview) reads the branch and lists what a sync would add, change, or leave alone. It writes nothing: no page, no note, no kept file. It works while a source is off.

It runs by itself after you save a mapping. When Choose Folders, Add One, or the data file guide saves a mapping, a What Would Change box opens on the source's card and shows what a sync would add (New), update (Changed), and mark as removed from GitHub (Gone From GitHub), with each page's address and reason. A mapping that would read nothing is named in words, so a wrong folder is seen before anything imports. The check reads the repository and saves nothing. Dismiss takes the box away, and it shows again after the next save.

Sync Now

A person turns a source on with Turn On (action sites.source.set, needs the permission to publish a website), then presses Sync Now (action sites.source.sync). The work runs in the background, a few files at a time, and the page shows its progress: the bar fills in place, and the rest of the card stays still until the sync ends.

  • Drafts. Each page is made or updated as a draft that waits in the website's list of changes. Nothing is made ready or published, unless a mapping is set to Publish Automatically (below).
  • Only what changed. A sync reads the branch's newest commit first. If it is the one already synced, it stops. Otherwise it reads only the files whose content changed since the last sync. A page a person removed makes the next sync read its file again, even on the same commit.
  • Syncing again is safe. A second sync of the same folder updates each page in place by its file. It never makes a second page and never needs a page deleted first. A page that a person removed, whose file is still in the folder, comes back as a draft in the same place ("The page had been removed. It was brought back as a draft."). A page made by hand and then removed still holds its address, so its file is listed as Refused with the reason, and the page is not touched.
  • A page made by hand is never changed. If a file's address matches a page a person made, the file is refused, the page is kept exactly as it is, and the people who manage Websites are told on the bell and in Needs You Today, once for each file.
  • A removed file changes nothing. The file's page is marked as removed from GitHub, left exactly as it is (a live page stays live), and the people who manage Websites are told once. A sync never deletes a page.
  • Limits. A sync reads up to 500 files, each up to 200,000 characters of text (a data file up to 800,000), plus the pictures they point at (see Pictures From GitHub). A mapping set to the Designed docs layout, or with Richer Markdown on, has no file count or file size limit: its files are read over several turns and a large file is split into parts (see Designed Docs From GitHub). A larger first sync is refused with the count, and you choose a smaller folder. A file that is not text, is too large, or makes an address that cannot be used is skipped with its reason. Two files that make the same address keep the first.

When a Sync Reads Nothing or Cannot Start

A failed sync or preview says what failed, in words, and never shows a key or a token:

  • The repository cannot be read. "The branch main was not found in owner/name, because the repository could not be read with the saved GitHub access." Check the repository name, and that the token has Contents and Metadata with Read only for that repository.
  • The branch is not there. "The branch main was not found in owner/name. The repository can be read, so the branch name is wrong or the branch was deleted."
  • A folder is not on the branch. "Nothing was read for docs/helpdesk. The folder was not found on the branch main." When only the capital letters differ, it says which folder is there, because paths match capital letters exactly. A slash at either end of a path makes no difference.
  • A folder has no pages. "Nothing was read for docs/empty. The folder has no pages." A mapping reads .md, .markdown, .html, and .htm files (and .json data files for a collection).

When no mapping reads anything, the run ends as failed with those words. When some do, their pages come in, each empty mapping is a Skipped line in the list, and the run's line adds how many mappings read nothing.

Publish Automatically

A mapping can be set to Publish Automatically instead of Keep as a Draft. Then a sync marks that mapping's changed pages ready and publishes the website, as the person who chose it and with their permission to publish (action sites.source.save). It is the same publish as the Publish button, so it publishes every ready page of the website, and Go Back in History returns to the version before.

  • A person's choice. Only a person who can publish a website chooses it. An assistant or key cannot, and one that is already on can only be kept or turned off. If the person later loses the permission to publish, the mapping goes back to drafts until someone with the permission chooses it again.
  • The first sync is always drafts. The first sync of a new mapping is saved as drafts whatever it says, so you see everything first. The next syncs follow its choice.
  • Never over an assistant's change. While a change an assistant saved is waiting for a person, nothing is published. The sync saves its changes as drafts and says why.
  • Never by an assistant. A sync an assistant starts always makes drafts.
  • **A file that says ready: false** at the top stays a draft.
  • Removed files change nothing. A file removed from GitHub never takes a live page offline, even with Publish Automatically. You decide.
  • What Changed shows which items went live, and the sync's message says which version was published.

Start It From GitHub or on a Schedule

A sync can start three ways: you press Sync Now, GitHub tells the website about a push, or a schedule is due. A source's What Starts a Sync block shows each.

  • A push to the branch. Make Address (action sites.source.hook.make, for owners, admins, and anyone whose role allows managing websites) makes the source's own address and a secret, shown once with a Copy button. In the repository on GitHub, open Settings, Webhooks, Add webhook, paste the address, set the content type to application/json, paste the secret, and choose just the push event. The address never changes for the life of the source. Replace Secret makes a new secret and the old one stops at once. Turn Off Address and Turn On Address (action sites.source.hook.set) stop and start deliveries. Address shows the address and the recent deliveries, with only their time and what happened (action sites.source.hook.show).
  • A schedule. Off at first. Choose Every Hour, Every 6 Hours, or Daily (action sites.source.schedule, for people who can publish a website). It never runs more often than every hour, and it stops when the source is turned off.

Each delivery is checked inside your account before anything is read: its signature (made with your secret), its size (1 MB at most), and its delivery id (a repeat is ignored). Thirty deliveries a minute are taken. Only a push to the source's branch in the source's repository counts; a ping, another branch, or a deleted branch is answered and dropped. A source that is off takes the delivery and drops it. A delivery only queues a sync and answers at once. Pushes close together become one sync of the newest commit, and a push that comes while a sync is running adds one more sync after it. A sync that finds the branch at the commit it already synced stops after one call to GitHub. Every sync a push or a schedule starts follows each mapping's own choice, drafts or Publish Automatically.

The body GitHub sends is read in memory and dropped. It is never kept or logged, and neither is your secret.

What Changed

Each preview and sync ends with a list (action sites.source.changes): the commit, then each item with Added, Changed, Removed, Skipped, or Refused, its address, its file, and a plain reason. It holds names and addresses, never the text of a file.

When Something Goes Wrong

The page says it in plain words: GitHub did not accept the key, the repository is not on your connection, the branch was not found, the repository is too large to read in one go, or GitHub is busy (it is tried three times, then stops and says so). Nothing is changed by a sync that stops.

Remove a Source

Remove (action sites.source.remove) hides a source and turns it off. It is kept, Bring Back returns it, and the pages it made stay exactly as they are.

Who Can Do It

  • Anyone who can see websites can see sources, syncs, and changes.
  • People who can build websites (the edit permission) add and change sources and mappings, choose folders, preview pages, press Preview and Sync Now, and remove a source.
  • People who can publish a website turn a source on or off.
  • Connecting GitHub is for owners and admins, in Settings, then Connections.

For AI Agents

An assistant can list sources (sites.source.list), read the changes of a sync (sites.source.changes), save a source and its mappings (sites.source.save, always turned off), and queue a preview or a sync (sites.source.sync). A sync an assistant starts makes drafts only, whatever a mapping says. An assistant cannot choose Publish Automatically and cannot publish. The tree and Preview Pages read your repository with your own key, so they are for a person at the screen, not for an assistant: an assistant uses the preview run (sites.source.sync, preview) and reads it with sites.source.changes. The save tool accepts up to 100 mappings, the Never Map list, and address_field for a collection from a data file. An assistant can also set picture_visibility (private or public) and apply_to_existing: Private applies at once, and Public waits for an owner or admin to say yes in the workspace. An assistant cannot connect GitHub, make or replace a source's address or secret, turn a source or its address on, set a schedule, or remove a source.

What Is Kept

Counts, commit ids, file paths, page addresses, and plain reasons, in your own account. Never the text of a file and never your key. The pages a sync makes are ordinary pages of your website, kept in your account like any other, and included in Export Everything with your sources.

Designed Docs Layout

A mapping of a folder of docs has a Docs Layout setting, Current (the start) or Designed, plus Richer Markdown, Callout Headings, and Status Comes From. Designed makes an overview page from each index.md and a guide page from every other file, with a menu, a status, screenshots in frames, and Previous and Next. A mapping on Current makes exactly the pages it always made. Everything about it is in Designed Docs From GitHub.

Where to Find It

Websites, then Sources, then Add a Source. The picture choice is in Change Source, under Pictures From This Source; only owners and admins can save Public. Owners, admins, and anyone who may edit websites see it. The GitHub connection is added in Settings, then Connections.