# Sharing and publishing

Everything you save starts private. There are two ways to show reading to other people: an unlisted link to chosen items, and a public page under a handle. Both are optional and both need an account.

## What other people can see

A shared or public item shows its title, a link to the original source, and the parts of its summary you have accepted. A shared link can also include your highlights when you ask for that. The saved article text, your notes and your reading state are never published.

Public pages carry `noindex`, which asks search engines not to list them.

## Share a link

A share link shows one or more items to anyone who has its address. It is not listed anywhere.

In the web library, open an item, choose **Share**, then **Copy link**. From a terminal:

```sh
sponge share ITEM --title "Worth reading"
sponge share ITEM ITEM --highlights     # include your highlights
sponge share list
sponge share revoke ID
sponge sync
```

The link has the form `https://account.sponge.computer/s/<id>`. A link made in the terminal goes live on the next `sponge sync`. Revoking removes the page; copies someone already fetched may remain, and the address is never reused.

## Your public page

1. In the web library, open **Your profile** and claim a handle of 2 to 30 characters. You can add a display name and a short bio. A handle is fixed once claimed.
2. Publish items: set an item public in the web library, or run `sponge publish ITEM...`.
3. Sync. Your devices build the page and upload it.

```sh
sponge publish                 # what is public, and whether new saves publish
sponge publish ITEM ITEM
sponge unpublish ITEM
sponge sync
```

Claiming a handle publishes nothing by itself. With at least one published item, these addresses exist:

| Address | What it is |
| --- | --- |
| `https://account.sponge.computer/@handle` | Your public reading page |
| `/@handle/feed.json` | JSON Feed |
| `/@handle/feed.xml` | Atom feed |
| `/@handle/embed` | A small list for an iframe on your own site |

A handle with nothing published returns `404`.

### Publish new saves automatically

```sh
sponge publish --auto on
sponge publish --auto off
```

Automatic publishing is off by default. When on, new saves from public web pages are published; pages captured through your signed-in browser stay private. The setting syncs between your devices and is also in **Your profile**.

### Embed your reading

**Copy embed code** under **Share** copies an iframe for `/@handle/embed`. It lists your newest public items. `limit` accepts 1 to 30 and defaults to 8; `theme` accepts `auto`, `light` or `dark`.

```html
<iframe src="https://account.sponge.computer/@handle/embed?limit=5&theme=light"
        title="Recent reading" loading="lazy"></iframe>
```

## Host the list yourself

`sponge publish --output` writes a signed static site with a JSON Feed to a directory, for hosting anywhere.

```sh
sponge publish --dry-run
sponge publish --output /absolute/site --title "My reads" --base-url https://reads.example.com/
```

## Taking things down

`sponge unpublish ITEM`, **Revoke** on a link, or setting an item private removes its public file on the next sync. Public pages are cached for up to a minute. Sponge cannot recall a copy that someone already fetched or that another service indexed from a link you posted.
