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
- In
_config.yml, seturltohttps://YOUR-USERNAME.github.ioandbaseurlto/YOUR-REPOSITORY-NAME. - Push your changes to GitHub.
- On GitHub, go to Settings > Pages. Under Build and deployment, set Source to Deploy from a branch. Set the branch to
mainand the folder to/ (root). Select Save. - Wait a few minutes. GitHub shows the site address at the top of the Pages settings.
Use your own domain (optional)
- With your domain provider, add a
CNAMErecord for a subdomain, such aspll.example.org, that points toYOUR-USERNAME.github.io. - On GitHub, go to Settings > Pages. Under Custom domain, type the subdomain and select Save. GitHub adds a file named
CNAMEto your repository. Pull it before you push again. - In
_config.yml, seturltohttps://pll.example.organdbaseurlto"". - 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
- In
_config.yml, seturlto the final address, such ashttps://example.org. Setbaseurlto the folder the site will be in, or""for the top level. -
Build the site:
JEKYLL_ENV=production bundle exec jekyll build - Jekyll puts the finished site in the
_sitefolder. Copy everything in_siteto the web server. Do not copy the other folders. - Set the server to show
404.htmlwhen 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.htmland the error document to404.html. Each page is a folder with anindex.htmlfile in it, which S3 supports. - Cloudflare (Workers or Pages static assets): Upload the contents of
_site. Set “not found” handling to use404.html.
Before you publish
- Replace all placeholder text: search the files for
[State],Placeholder, andWriting prompt. - Check every link and phone number.
- Do the checks in Accessibility.