mirror of
https://github.com/tiennm99/blog.git
synced 2026-10-12 10:13:25 +00:00
4d64da13dcb11b8dfae394977b00bb82a641d42d
Run 25919953710 still failed htmltest on both Hugo legs. Two distinct
issues, both pre-existing latent bugs that v0.3.0 made impossible to
ignore:
1. Several theme templates piped paths with a leading slash through
`relURL`, which in Hugo means "this is already absolute — leave it
alone." The intended subpath prefix (`/tsuki/`) was therefore never
added, producing hrefs like `href="/search/"` and `href="/"`. In
production the GitHub Pages mount masked this (broken links from
the page's perspective still happened to resolve under the repo
path most of the time), but htmltest correctly reported them as
broken. Fix by either:
- using `site.Home.RelPermalink` for the home link, or
- piping a string without a leading slash through `relLangURL`
(so Hugo prepends the baseURL path), or
- stripping the leading slash from data-driven URLs first via
`strings.TrimPrefix "/"` and then `relLangURL`.
Affected: header.html, search-button.html, recent-posts.html,
home/hero.html, nav.html, 404.html, search/list.html (Pagefind UI
asset URLs).
2. htmltest has no URL-rewriting feature (the `URLSwap` config in the
prior `d30f50f` "fix" was never read by htmltest — confirmed by
reading htmltest 0.17.0 source). The only clean way to make
internal-link checking work with a `/repo/`-style baseURL is to
mirror the URL structure on disk. CI now builds with
`hugo --destination public/tsuki`, runs Pagefind/smoke/htmltest
against that path, and uploads `exampleSite/public/tsuki/` as the
Pages artifact. The artifact contents become the served site
under `/tsuki/`, identical to the prior behaviour from the
browser's point of view. `.htmltest.yml` drops the dead URLSwap
block.
Also: `tmp/` (htmltest's runtime cache) added to .gitignore so local
runs don't dirty the working tree.
Local verification: 32 smoke checks green; htmltest reports
`✔✔✔ passed, tested 29 documents` against the subpath build.
miti99
Source of miti99.com — personal blog (VN/EN) built with Hugo and the Stack theme.
Quick start
git submodule update --init --recursive
hugo server -D
Site available at http://localhost:1313.
Content structure
Posts live under content/post/YYYY/MM/DD/index.md. Each post is a Hugo leaf bundle — images and assets sit next to index.md in the same directory.
content/
post/
2024/
03/
15/
index.md ← post content (Vietnamese / English)
cover.jpg ← optional cover image
page/ ← standalone pages (about, projects, …)
Theme customization
Theme config lives in config/ (Hugo config directory split). Key overrides:
config/_default/params.toml— sidebar, avatar, footer, color schemeconfig/_default/menu.toml— navigation linksassets/— custom CSS/JS overrides loaded on top of the Stack themelayouts/— template overrides (add a file here to override any Stack partial)
The Stack theme is pulled in as a git submodule under themes/hugo-theme-stack/.
License
Apache-2.0 — see LICENSE.
Description
Source of miti99.com — personal blog (VN/EN) built with Hugo + Stack theme.
147 MiB
0 Stars
1 Watchers
0 Forks
Languages
JavaScript
59%
HTML
21.2%
CSS
15.6%
Shell
4.2%