Skip to content

Table of Contents

🌐 Publishing the Docs Site

This repo can be published as a public learning-docs website while the GitHub repository stays private. The site is built from the Markdown with Material for MkDocs; only the rendered content is exposed — there is intentionally no link back to the private repo in the site.

What gets built

scripts/build-docs.py assembles the publishable Markdown into docs_build/ (so MkDocs' site_dir can sit outside its docs_dir), then mkdocs build renders it to site/. Both folders are git-ignored.

pip install -r requirements-docs.txt
python3 scripts/build-docs.py && mkdocs serve   # preview at http://localhost:8000
# or a one-off static build:
python3 scripts/build-docs.py && mkdocs build   # output in ./site
  1. Cloudflare dashboard → Workers & Pages → Create → Pages → Connect to Git.
  2. Authorize GitHub and pick nabin747/go-from-zero (private is fine).
  3. Build settings:
  4. Framework preset: None
  5. Build command: pip install -r requirements-docs.txt && python3 scripts/build-docs.py && mkdocs build
  6. Build output directory: site
  7. Environment variable: PYTHON_VERSION = 3.12
  8. Save and Deploy → you get a public https://<project>.pages.dev URL.

The repo, code, and commit history stay private; every push to main auto-rebuilds the site.

Option B — Netlify (zero-config via netlify.toml)

  1. Netlify → Add new site → Import an existing project → GitHub → authorize → pick the repo.
  2. Build command, publish dir (site), and Python version are read automatically from netlify.toml. Click Deploy.

Option C — GitHub Actions → Cloudflare Pages (token-based, no dashboard connect)

The deploy-docs.yml workflow builds the site on every content push and deploys it to Cloudflare Pages. It always builds (so a broken docs build is caught) and only deploys when the secrets exist, so it stays green until you configure it.

  1. Create a Cloudflare API token (My Profile → API Tokens → Create) with the Account → Cloudflare Pages → Edit permission, and note your Account ID.
  2. In the repo: Settings → Secrets and variables → Actions → New repository secret — add:
  3. CLOUDFLARE_API_TOKEN
  4. CLOUDFLARE_ACCOUNT_ID
  5. Push to main (or run the workflow manually). The Pages project go-from-zero is created automatically on the first deploy.

Suggested URL: https://go-from-zero.pages.dev (Cloudflare serves <project>.pages.dev). pages.dev subdomains are globally unique — if go-from-zero is taken, rename the project (e.g. nabin-go-from-zero) and update --project-name in the workflow plus site_url in mkdocs.yml.

After your first deploy

  • Set site_url: in mkdocs.yml to the published URL so the sitemap, canonical links, and social cards are correct.
  • (Optional) Add a custom domain in the host's dashboard.

Privacy summary

Exposed publicly Stays private
Rendered notes, cheatsheets, interview Qs, project SPECs/READMEs The GitHub repository
The learning content as a readable site Source .go internals beyond what notes link, full git history, issues, board

The site is content-only by design. If you later make the repo public, you can add repo_url: to mkdocs.yml to turn on "edit this page" links.


docs · Repo README