From 49dd22dcd348f269e700e90a3b048bbcd1f971dc Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sat, 3 Oct 2026 12:37:32 +0700 Subject: [PATCH] feat: build at the domain root on hosts other than GitHub Pages baseURL is now "/"; the Pages workflow still injects the /iammiti99/ Pages URL. README documents Cloudflare Pages, Netlify and Vercel settings. --- README.md | 20 ++++++++++++++++++++ hugo.yml | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ae5c3c8..d41db6c 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,26 @@ General → Workflow permissions** is set to "Read and write"). (Optional) Custom domain: drop a `static/CNAME` file containing your apex domain — Hugo will copy it through to the deployed site. +### Base URL + +`hugo.yml` sets `baseURL: /`, so a plain `hugo` build serves from the domain +root. The GitHub Pages workflow overrides it with the Pages URL +(`https://.github.io/iammiti99/`), so only that host gets the +`/iammiti99/` subpath. + +### Other hosts (Cloudflare Pages, Netlify, Vercel) + +| Setting | Value | +|---|---| +| Build command | `hugo --gc --minify` | +| Output directory | `public` | +| Env `HUGO_VERSION` | `0.154.0` (Hugo Extended) | +| Env `HUGO_BASEURL` (optional) | the site's full URL, e.g. `https://iammiti99.pages.dev/` | + +Without `HUGO_BASEURL` the site is served from the host's root URL, but +`og:image` and the canonical link stay relative. Set it so social link previews +get absolute URLs. + ## Project layout ``` diff --git a/hugo.yml b/hugo.yml index 03e34e0..7579e15 100644 --- a/hugo.yml +++ b/hugo.yml @@ -1,4 +1,4 @@ -baseURL: https://tiennm99.github.io/iammiti99/ +baseURL: / languageCode: en title: Tien — links theme: bonsai