Skip to main content
People's Law Library

Publish the site

The site is static: a folder of plain HTML, CSS, JavaScript, and font files. It does not need a database or server software such as PHP. Any web server can host it.

On GitHub Pages

  1. In _config.yml, set url to https://YOUR-USERNAME.github.io and baseurl to /YOUR-REPOSITORY-NAME.
  2. Push your changes to GitHub.
  3. On GitHub, go to Settings > Pages. Under Build and deployment, set Source to Deploy from a branch. Set the branch to main and the folder to / (root). Select Save.
  4. Wait a few minutes. GitHub shows the site address at the top of the Pages settings.

Use your own domain (optional)

  1. With your domain provider, add a CNAME record for a subdomain, such as pll.example.org, that points to YOUR-USERNAME.github.io.
  2. On GitHub, go to Settings > Pages. Under Custom domain, type the subdomain and select Save. GitHub adds a file named CNAME to your repository. Pull it before you push again.
  3. In _config.yml, set url to https://pll.example.org and baseurl to "".
  4. When it becomes available, select Enforce HTTPS.

If your GitHub account’s main site (YOUR-USERNAME.github.io) already uses a custom domain, GitHub sends all your project sites to that domain. In that case, give this site its own subdomain.

GitHub builds the site again each time you push to main. GitHub uses the same Jekyll version as the github-pages gem in the Gemfile, so the site looks the same as your preview.

On another web server

  1. In _config.yml, set url to the final address, such as https://example.org. Set baseurl to the folder the site will be in, or "" for the top level.
  2. Build the site:

    JEKYLL_ENV=production bundle exec jekyll build
    
  3. Jekyll puts the finished site in the _site folder. Copy everything in _site to the web server. Do not copy the other folders.
  4. Set the server to show 404.html when a page is not found.

Build the site again each time you make a change, and copy the new _site folder. Copy the whole folder: when a page is deleted or moved, the old file stays on the server unless you delete it.

The _site folder is not saved in Git (it is listed in .gitignore). Build it again whenever you need it.

Notes for some hosts

  • Amazon S3 static website hosting: Set the index document to index.html and the error document to 404.html. Each page is a folder with an index.html file in it, which S3 supports.
  • Cloudflare (Workers or Pages static assets): Upload the contents of _site. Set “not found” handling to use 404.html.

Before you publish

  • Replace all placeholder text: search the files for [State], Placeholder, and Writing prompt.
  • Check every link and phone number.
  • Do the checks in Accessibility.
URL: https://plldemo.briannaimm.com/docs/publishing/