Hosting and build output

A publish builds the site into dist/: static HTML, CSS, images and a few text files. Any static host can serve it. Splitleaf sends it to Vercel, or to a dist branch for the host you pick.

To pick the host, see Publishing.

What the build does

  1. Reads the page files, the content and splitleaf.config.json.
  2. Puts each component into the pages that use it.
  3. Fills the content lists and the content templates.
  4. Removes the Splitleaf markers. See Data attributes.
  5. Writes the head: title, canonical, Open Graph, hreflang and favicon links.
  6. When Auto compress images is on, makes AVIF versions of the images in /assets/, and wraps each <img> in a <picture>. SVG files stay as they are.
  7. Copies public/ to the site root.
  8. Writes robots.txt, sitemap.xml, _redirects and, when you set it, llms.txt.

Draft and archived pages and items are not built. An Incomplete item does not go live.

The build output

dist/
  • index.html
  • about/index.htmlclean URLs: /about
  • blog/summer-pop-up/index.htmlone page for each published item
  • 404.html
  • 404/index.html
  • styles/a new name on each change
    • fonts.3a91c0de.css
    • variables.8b2e4f17.css
    • site.c47d9a02.css
    • components.51f0b8e3.css
  • assets/from public/assets/, with AVIF versions
  • favicons/when you set a favicon
  • opt-filter.jsonly when a page has a filter form
  • _redirects
  • robots.txt
  • sitemap.xml
  • llms.txt
  • Each stylesheet name holds a hash of its content, so browsers load the new CSS after a publish.
  • sitemap.xml needs the site address. Set a primary domain on the Publishing tab.
  • _redirects holds your redirects for hosts that read the file.
  • With IndexNow on, the build also writes a key file, <key>.txt.

A staging build adds noindex, nofollow, and its robots.txt blocks every crawler.

Note: dist/ is made again on each publish. Do not edit it. Edit the source files.

Vercel

With Vercel, the App uploads dist/ to your Vercel project through the Vercel API. Vercel builds nothing. The files that Splitleaf built are the files that go live.

  • dist/ stays out of Git. Your repository holds only the source.
  • The App writes a vercel.json for each upload: clean URLs, trailing slashes, redirects and language redirects.
  • The site folder never holds this vercel.json. It lives in the App's cache.
  • When the primary domain is your own domain, the *.vercel.app address gets X-Robots-Tag: noindex, nofollow.

A push to main on GitHub does not change the live site. See Git and GitHub.

Manual hosting

With Manual hosting, Splitleaf publishes to GitHub only. Each publish puts the built site on the dist branch, as one commit with no history. If your repository already has a dist branch, the App uses splitleaf-dist. The Publishing tab names the branch.

  1. In Site settings, click Publishing.
  2. Type the address of the site in Site URL.

Set up your host, for example Cloudflare Pages, Netlify or AWS:

  1. Connect the host to the GitHub repository of the site.
  2. Set the branch to the branch that the Publishing tab names, usually dist.
  3. Leave the build command empty.
  4. Set the output folder to the root of the branch.

The host then deploys on each publish. _redirects and 404.html at the root work on hosts that read them, for example Cloudflare Pages and Netlify.

Staging

Stage writes the staging branch and never the live site. A staging site is a domain for that branch on Vercel. It is optional. See Staging.

Domains

To link a domain, see Link a custom domain.