# Hugo hosting

Host a Hugo site: run hugo, then npx lobsite deploys public/ and uploads only the pages that changed. No account needed to try it, HTTPS from the start.

On the web at https://lobsite.com/hosting/hugo

```sh
hugo --minify && npx lobsite
```

Hugo builds into public/, and npx lobsite finds it and deploys it.

Hugo turns a folder of Markdown into a complete site in milliseconds, written to `public/`. Lobsite puts that folder online just as fast: run `hugo`, then `npx lobsite`, and the site is live at a `*.lobsite.app` address with HTTPS. There's no Node.js project needed beyond `npx`, and no build server to keep at the same Hugo version as yours.

## How it works

1. **Build the site** with `hugo --minify`. Hugo writes it to `public/`.
2. **Run `npx lobsite`** in the site's folder. It finds `public/` and deploys it. The first deploy needs no account and lasts 6 hours.
3. **Keep it** with the claim link, in a free account. The folder is saved in `lobsite.toml`; from then on, `hugo --minify && npx lobsite` updates the site.

## baseURL and a clean public/ folder

```toml
# hugo.toml
baseURL = "https://my-site.lobsite.app/"
```

- **`baseURL`** is your full address, with the trailing slash. Hugo uses it for absolute links, RSS feeds and the sitemap. Set it to your `*.lobsite.app` address, and update it when you move to your own domain.
- **Hugo doesn't empty `public/`** between builds. A page you deleted or renamed stays there, and gets deployed. Build with `hugo --minify --cleanDestinationDir`, or delete `public/` first, so what you deploy is exactly the current site.
- **Drafts and future posts** are left out unless you build with `--buildDrafts` or `--buildFuture`, so a normal `hugo` build is safe to deploy.

## Why big Hugo sites deploy fast

A Hugo site with thousands of pages still changes only a few files per post, plus the list pages and feeds that link to it. Lobsite stores files by their hash and uploads only the ones whose content changed, so a deploy after a new post sends kilobytes, not the whole site. Images Hugo processed in an earlier build keep the same content and aren't sent again. To check a deploy before it goes live, run `lobsite deploy --preview` and open its URL.

## Hugo hosts compared

| | Lobsite | GitHub Pages | Netlify | Cloudflare Pages |
|---|---|---|---|---|
| Builds Hugo for you | No: you deploy `public/` | In GitHub Actions | Yes | Yes |
| Hugo version | Yours, whatever it is | Set in the workflow | Set in a variable | Set in a variable |
| Account before the first deploy | No: live 6 hours, then keep it free | Yes, and a repository | Yes | Yes |
| Only changed files upload | Yes | Through Git | Yes | Yes |
| Forms without a backend | Yes, once the site is in an account | No | Yes | No |
| Custom domain | Yes, free | Yes | Yes | Yes |

Hosts that build from Git suit a team where nobody builds locally. If you already run `hugo` on your machine, deploying the result skips the build server, its version settings and its waiting time.

## Frequently asked questions

### Do I need Node.js to deploy a Hugo site?

Only for `npx`, which runs the Lobsite CLI. Your Hugo project needs no `package.json`. Without Node, drop the `public/` folder in the box above, or on your dashboard once the site is in your account.

### Why do deleted pages still show up on my Hugo site?

Hugo leaves old files in `public/`. Build with `--cleanDestinationDir`, or remove `public/` before building, then deploy again.

### Does Hugo's 404 page work?

Yes. A `layouts/404.html` template builds `404.html`, and Lobsite serves it with a 404 status for any address that doesn't exist.

### Which baseURL should a Hugo site on Lobsite use?

Your site's address, such as `https://my-site.lobsite.app/`. When you rename the site, or move to your own domain, change `baseURL` and build again.

