# Jekyll hosting

Host a Jekyll site with any plugin: build it with bundle exec jekyll build, then npx lobsite deploys _site/. No repository needed; forms included.

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

```sh
bundle exec jekyll build && npx lobsite
```

Jekyll builds into _site/, and npx lobsite finds it and deploys it.

Most Jekyll sites live on GitHub Pages, which builds them for you, but only with the plugins GitHub allows, and only from a repository. Building Jekyll yourself removes both limits: run `bundle exec jekyll build` and the finished site is in `_site/`. Then `npx lobsite` puts it online at a `*.lobsite.app` address with HTTPS, with forms that GitHub Pages doesn't have.

## How it works

1. **Build the site** with `JEKYLL_ENV=production bundle exec jekyll build`. Jekyll writes it to `_site/`.
2. **Run `npx lobsite`** in the site's folder. It finds `_site/` and deploys it. The first deploy needs no account and lasts 6 hours.
3. **Keep it** with the claim link, in a free account. After that, the same two commands update the same address.

## Moving from GitHub Pages

- **Any plugin works.** GitHub Pages only runs the plugins in the `github-pages` gem. When you build yourself, everything in your `Gemfile` runs, including ones GitHub Pages refuses.
- **`baseurl`** is often `/repo-name` on a GitHub Pages project site. On Lobsite the site is served from the top of its address, so set `baseurl: ""` in `_config.yml`, and `url` to your `*.lobsite.app` address.
- **The `github-pages` gem** can be swapped for plain `jekyll` in your `Gemfile`, so you choose the Jekyll version instead of GitHub.
- **No repository needed.** The site can still live in Git, but deploying doesn't depend on a push.

## Redirects, forms and feeds

`jekyll-redirect-from` makes HTML pages that redirect with JavaScript or a meta refresh. On Lobsite you can use real 301 redirects instead, in `lobsite.toml`, which search engines treat as a move; the [Redirect Generator](https://lobsite.com/tools/redirect-generator) writes them. Forms posting to `/_lobsite/forms/contact` collect submissions with spam filtering once the site is in an account, with no Formspree or other service. Feeds from `jekyll-feed` and sitemaps from `jekyll-sitemap` are files in `_site/` and are served as they are.

## Jekyll hosts compared

| | Lobsite | GitHub Pages | Netlify |
|---|---|---|---|
| Builds Jekyll for you | No: you deploy `_site/` | Yes | Yes |
| Plugins | Any | The `github-pages` set, or any with GitHub Actions | Any |
| Needs a repository | No | Yes | For Git deploys |
| Account before the first deploy | No: live 6 hours, then keep it free | Yes | Yes |
| Forms without a backend | Yes, once the site is in an account | No | Yes |
| Custom domain | Yes, free | Yes, free | Yes, free |

GitHub Pages is free with a custom domain and is a fine home for a Jekyll site that fits its rules. Lobsite is for when you want any plugin, real redirects or forms, and a deploy that's one command from your machine.

## Frequently asked questions

### Can I use Jekyll plugins that GitHub Pages doesn't allow?

Yes. You build the site yourself, so every plugin in your `Gemfile` runs. Lobsite only hosts the result in `_site/`.

### My Jekyll site's CSS is missing after moving from GitHub Pages. Why?

`baseurl` is probably still set to the repository name, so links point at `/repo-name/assets/...`. Set `baseurl: ""` in `_config.yml`, build again and deploy.

### Do I need Ruby on the machine that deploys?

You need Ruby to build Jekyll, as always. Deploying needs Node.js for `npx lobsite`; without it, drop `_site/` in the box above.

### Can I keep my Jekyll site in a GitHub repository?

Yes. Keep the source where it is and deploy from your machine. Deploying from GitHub Actions needs a CI token, which comes with the paid plan, coming soon.

