Docs Preview and GitHub Pages
This page explains how to validate the docs UI locally before publishing and how to configure GitHub Pages correctly.
Quick local preview in editor
For fast content checks:
- Open any file in
docs/ - Use Markdown preview in your editor
- Verify headings, links, and code blocks
This method is fast, but it does not fully reproduce layout behavior from Jekyll templates.
Full local preview with Jekyll and Docker
From repository root:
docker run --rm -it -p 4000:4000 -v "${PWD}:/srv/jekyll" jekyll/jekyll:pages jekyll serve --source /srv/jekyll/docs --destination /srv/jekyll/docs/_site --watch --force_polling
Then open:
http://localhost:4000
This gives a near-production preview of:
- global layout
- sidebar and top navigation
- dark mode toggle
- generated table of contents
- previous/next links
GitHub Pages publishing setup
In repository settings:
- Open Settings -> Pages
- Source: Deploy from a branch
- Branch: main
- Folder: /docs
- Save
Expected site URL pattern:
https://<username>.github.io/<repository>/
For this repository:
https://shanen28.github.io/license-guard/
Common Pages issues
Site not updating
- Wait for the Pages workflow to complete
- Check GitHub Actions logs for build failures
- Ensure files are committed in
docs/onmain
Missing styles or scripts
- Verify paths are relative (
/license-guard/assets/...) - Ensure
docs/assets/...files exist in the branch
404 on page links
- Use
.htmllinks in navigation for static pages - Confirm page filenames match link targets