# Publish a site

Publish a folder, and MemoMori builds it into a website at
`https://<name>.memomori.net` that anyone can read. Publish comes with
[Pro](/docs/plans), one site included.

To send one note or folder to a few people, a [share link](/docs/sharing) is
quicker. Publish when you want a site with its own address, a sidebar and
search.

## Publish a folder

1. Pick **Publish…** from the folder's menu, or open [Publish](https://memomori.app/publish)
   and click **New site**.
2. Type a name. It becomes the address, so `kyoto` gives `kyoto.memomori.net`.
3. Click **Publish**.

The site goes live when the build ends, most often within a minute.

The folder needs at least one `.md` file, and a folder can have one site.

## Pick a name

A name is 3 to 63 lowercase letters, digits and hyphens. It starts and ends
with a letter or digit, and can't have `--` as its third and fourth
characters, as in `xn--`. A few names, such as `www` and `docs`, are reserved.

Names are first come, first served. The Publish dialog tells you at once if a
name is taken.

## Update the site

A site is a snapshot of the folder. Your edits stay private until you open
the site on the [Publish](https://memomori.app/publish) page and click **Update site**. Once
the folder differs from what is live, the site's book gets a ribbon and reads
**Changed**.

If a build fails, the site keeps the last version that worked, and the page
shows why the build failed.

A site uses no extra storage: it serves the files in your folder as they are.
If you delete a file the site shows, the site keeps it until you update or
unpublish the site.

The site follows its folder when you rename or move it. If you delete the
folder, the site stays up as last built but can't update. Unpublish it to
take it down.

## Roll back

Each update keeps the edition before it. To serve that one again, open the
site on the Publish page and click **Roll back** under **Editions**. The site
switches within a minute, without a rebuild.

Your next update replaces the edition you rolled back from, so you can roll
back one step at a time.

## How notes become pages

- Every `.md` file is a page. `day-2.md` and `day-2/index.md` both serve
  `/day-2`, and `index.md` is the home page.
- The sidebar lists the folder's own pages first, then one group per
  subfolder, titled by its `index.md`.
- Every other file serves at its own path, so `photos/inari.jpg` serves
  `/photos/inari.jpg`.
- Files and folders whose names start with `.` or `_` stay off the site.

Frontmatter sets how a page shows up. All of it is optional:

| Key           | Sets                                                                    |
| ------------- | ----------------------------------------------------------------------- |
| `title`       | the page title; falls back to a leading `# Heading`, then the file name |
| `nav`         | a shorter label for the sidebar                                         |
| `description` | the page's summary for search engines, search and `llms.txt`            |
| `order`       | the page's place in its group, before titles sort the rest              |
| `hidden`      | `true` builds the page but lists it nowhere                             |
| `draft`       | `true` leaves the page off the site                                     |

A page with both a frontmatter `title` and a leading `# Heading` shows the
frontmatter title and drops the heading.

Each site also gets search (<kbd>Ctrl</kbd> <kbd>K</kbd>), a Markdown copy of
each page at its address plus `.md`, `llms.txt` and `llms-full.txt` for AI
tools, and a `sitemap.xml`. Each page gets a preview card, with its title and
`description`, that shows when someone shares the link.

Sites use [Charon](https://charon.memomori.app), the renderer behind these
docs.

## What shows on a page

These work as they do in your notes:

- Links: `[Day 2](day-2.md)` and `[[Day 2]]` link to pages in the folder.
- Images: `![Inari](photos/inari.jpg)` finds the file relative to the page.
- Drawings: `![[sketch.excalidraw]]` shows the drawing as a picture, and
  `![[sketch.excalidraw#Floor plan]]` shows one frame. The drawing must sit in
  the published folder.
- Callouts, code, tables, math, and `mermaid` diagrams.
- `csv` and `tsv` blocks, as tables.

These do not:

- Other `![[...]]` embeds show nothing. Write images as `![alt](path)`.
- `geojson` and `query` blocks show as code.
- A link to a missing page stays as written and leads nowhere.
- HTML in a note renders, but scripts don't run.

## Unpublish

Open the site on the Publish page and click **Unpublish**. The site goes
offline within a minute.

To bring the site back as it was, click **Undo** on the message that appears,
or **Restore** on the site within 30 days. Restoring skips the rebuild. After
30 days anyone can take the name. To let it go sooner, click **Remove**
on the unpublished site.

## Price

Pro includes one site. Each extra site adds $8 a month, or $80 a year if you
pay yearly. MemoMori asks before it adds one, then charges your card at once
for the rest of your billing period.

Unpublishing a site gives no refund. It stays paid until the period ends, so
until then you can publish another site in its place at no charge. Your next
bill drops after that.

An account can publish up to 10 sites. **Settings → Billing** shows what your
sites cost.

Sites go offline if Pro ends or you schedule account deletion, and come back
when you subscribe again. A site offline for 30 days is removed and its name
freed.
