This site is made of two kinds of pages. Posts are generated from Nunjucks templates. The landing, policy, and lab pages are hand-written .html that gets copied byte for byte. The build config is exactly this short:

eleventyConfig.setTemplateFormats(["njk"]); eleventyConfig.addPassthroughCopy("src/**/*.html"); eleventyConfig.addPassthroughCopy("src/**/*.css"); eleventyConfig.addPassthroughCopy("src/**/*.txt"); eleventyConfig.addPassthroughCopy("src/images");

Only .njk is treated as a template, so nothing else is ever touched. That is the point — inline styles and deep-link scripts survive intact. And for exactly the same reason, the paths inside those files are invisible to the build.

1. Who Resolves a Relative Path

Start here. href="../../posts.css" is resolved by the browser, not the build, and the base it resolves against is not where the file sat on disk. It's the URL of the page currently being viewed.

Resolver Base Decided when ────────────────────────────────────────────────────────── Build none — copied as a string build time Browser the current document's URL request time

Every failure in this article is those two drifting apart. On disk the file is src/ko/lab/index.html and in the output it's _site/ko/lab/index.html — but the browser sees a URL, /ko/lab/. Disk path and URL staying the same shape is a convention of static hosting, not a guarantee. One redirect or one rewrite and they diverge.

2. What This Repository Actually Does

The passthrough pages, their depth, and the paths they use:

File Depth Path used Resolves to ────────────────────────────────────────────────────────────────────────── ko/index.html 1 ../images/ko/main.png /images/ko/main.png ko/privacy-policy.html 1 account-deletion.html /ko/account-deletion.html ko/account-deletion.html 1 ../en/account-...html /en/account-deletion.html ko/lab/index.html 2 ../../posts.css /posts.css ko/lab/fitness-type/index.html 3 /images/favicon.svg /images/favicon.svg

Three different conventions coexist in one repository. Within a locale, a bare filename (account-deletion.html). Crossing locales, one level up (../en/). Root assets, as many levels as the depth requires (../../posts.css). And the deepest page gives up and goes absolute (/images/…).

All of it is correct today. And all of it is correct only on the assumption that each file stays exactly where it is.

It's no accident that the deepest page went absolute.

You can count ../../ in your head. From ../../../ onward you count wrong. The single deepest page in this repository, lab/fitness-type/, is the only one that writes its asset paths absolute.

3. What the Build Checks, and What It Doesn't

This build catches a fair amount — the repository has been pushed steadily toward letting the build enforce the rules.

Checked By On failure ────────────────────────────────────────────────────────────────── ko/en post slug symmetry eleventy.before build fails ko/en date and category agreement eleventy.before build fails post-to-post link target exists eleventy.before build fails post-to-post link publish order eleventy.before build fails template syntax, missing refs 11ty build fails ────────────────────────────────────────────────────────────────── relative paths in copied HTML nobody silent 404 staticPages.js vs actual pages nobody sitemap lies internal links on landing pages nobody silent 404

The difference between the top five rows and the bottom three is whether anything opens the file. The post-link check works because the eleventy.before hook reads the sources itself and scrapes href="/en/posts/…" with a regex. Where no such check was written, there is no check at all — passthrough copy doesn't even read the file.

Splitting the sitemap into generated and declared parts hit the same structure. Knowing where the boundary runs between what follows automatically and what you maintain by hand is a more realistic goal than erasing the boundary.

4. The Four Ways It Breaks

a. A directory moved one level

The common one. Move ko/lab/index.html to ko/lab/tools/index.html and ../../posts.css now points at /ko/posts.css. No such file exists.

Before /ko/lab/ + ../../posts.css → /posts.css ✓ After /ko/lab/tools/ + ../../posts.css → /ko/posts.css ✗ Fix ../../../posts.css or /posts.css

The build succeeds. It doesn't even know the file moved.

b. A locale got duplicated

Writing a page under ko/ and copying it to en/ is the default operation in this repository. Depth is identical, so ../../posts.css stays correct. The trap is the link that crosses locales.

In ko/account-deletion.html: ../en/account-deletion.html Copied verbatim into en/: from /en/, ../en/… → /en/account-deletion.html = points at itself (the locale switch is dead) Correct value in en/: ../ko/account-deletion.html

This one doesn't even 404. The link works, and does nothing. You press the language toggle and the same page reloads — a bug that is invisible unless somebody actually clicks it.

c. The trailing slash is missing

A browser treats the last segment of a URL as a filename. Ending in a slash means a directory.

Current URL Base account-deletion.html means ────────────────────────────────────────────────────────────────────── /en/privacy-policy/ /en/privacy-policy/ /en/privacy-policy/account-… ✗ /en/privacy-policy /en/ /en/account-deletion.html ✓ /en/privacy-policy.html /en/ /en/account-deletion.html ✓

Same page, and the base for every relative path depends on which URL you arrived through. The host's URL normalization, redirects carrying traffic from old paths, and the exact shape of a shared link all feed into this. Which is why moving a path and adding redirects has to be handled together with a pass over that page's relative paths.

d. The URL moved, not the file

The hardest one to notice. Leave the source file where it is, change one rewrite in vercel.json so it serves at /en/experiments/, and the file depth is still 2 while the URL depth changed. Opening the file shows nothing unusual. What changed is a line in a config file.

Redirects and rewrites are not the same hazard.

A redirect changes the browser's URL, so the relative-path base moves with it. A rewrite keeps the URL and swaps the content, which means the base is the new URL while the paths inside were written for the old depth. Rewrites are far more dangerous here.

5. So Should Everything Be Absolute?

Mostly, yes. Not unconditionally. The test is "will this page always live at this depth, on this domain?"

Reference Absolute Relative Why ────────────────────────────────────────────────────────────────────── Site-wide assets ● posts.css, favicon, logo — (CSS, fonts, logo) one location, referenced from every depth ────────────────────────────────────────────────────────────────────── Locale switch links ● absolute prevents the copy-paste failure above ────────────────────────────────────────────────────────────────────── Sibling pages in same directory ● they move together, so relative survives the move ────────────────────────────────────────────────────────────────────── Page-specific images ● travels with the page ────────────────────────────────────────────────────────────────────── Site deployable under a subpath ● /… escapes the deploy root

That last row is the only condition that rules absolute paths out entirely. On a deployment that sits under example.com/myproject/ — a GitHub Pages project site, for instance — /posts.css resolves to example.com/posts.css and fails. This site deploys at the root of ceanlab.com, so it doesn't apply. Confirming it doesn't apply and then choosing absolute is a different act from just using absolute paths by habit.

Existing pages were not converted in bulk. Touching a passthrough page means re-verifying that whole page, and swapping a currently-correct path for a differently-correct path is less like fixing a bug and more like opening a door for one. The rule landed as: new references to shared assets go absolute; existing ones get converted when that page has to move anyway.

6. How to Verify

Since the build won't catch it, verification happens on the output. Look at _site/, not the source — rewrites and redirects create URLs that exist nowhere in the source tree.

1. Build npm run build 2. Extract only the relative paths from the output grep -rn 'href="\.\./\|src="\.\./' _site --include=*.html 3. For each hit compute (file depth − number of ../) A negative result escaped the root — that one is definitely a bug 4. Actually serve it and look for 404s npx serve _site then scan the Network tab for red rows. 404s are not loud, but they are visible there 5. Click the locale switch Whether an en page goes to ko or reloads itself is not a 404 — the only way to tell is with your eyes

Step 4 is the one that matters. Relative-path failures barely show up in server logs — what 404s is CSS or an image, so the visitor thinks "looks off" and leaves, while the page itself is logged as a clean 200. You have to open a browser and read the Network tab.

If you automate one step, automate step 3; it has the best cost-to-value ratio. For each HTML file in the output, resolve every path with URL and check whether the target exists under _site/, and fail if it doesn't. The post-link guard already has that shape, so there's a place to put it.

7. Common Questions

Wouldn't templating everything instead of passthrough fix this?

It would, because the template would generate the paths. The cost is that the landing page's inline styles and the deep-link fallback script all come within range of template syntax. Letting the build touch a hand-written 333-line <style> block is a steep price for that safety, and it doesn't pay off in this repository.

What about a <base> tag?

It works. It pins the relative-path base for one document. But it applies to every relative path in that document at once, including sibling-page links. You've added a second base to reason about, which makes debugging harder. If the goal is only to fix asset paths, writing those asset paths absolute is simpler.

Why don't posts have this problem?

A post's <head> comes from one file, _includes/partials/head.njk, and the stylesheet path there is the absolute /posts.css. A post's permalink can vary with its date or slug, so there was never a depth to count and absolute was the only option available. A constraint that happened to prevent a class of mistake.

Do broken images show up in the build log?

No. The build does not parse HTML content. A line like Copied 49 Wrote 51 files counts files; it says nothing about whether those files point at each other correctly.

Why not just run a link checker in CI?

That's the most reliable answer. Two decisions come with it. Do you check external links — if you do, somebody else's outage fails your build. And how do you handle scheduled posts? Future-dated posts are dropped from the output entirely here, so a checker that only walks the output will never see the links inside a post that hasn't published yet. It complements the source-reading guard rather than replacing it.

Should relative paths just be banned by a lint rule?

The cost is that sibling-page links get banned with them. In practice the balanced rule is to ban only two or more ../ segments: allow the depth a human can count, push anything deeper to absolute.

8. Takeaways

  • Passthrough copy never reads the file. Whatever is written inside, the build doesn't know.
  • A relative path resolves against the final URL, not the file location. One rewrite separates them.
  • Four failure modes — a moved directory, a duplicated locale, a missing trailing slash, a URL rewrite.
  • A copy-pasted locale switch doesn't 404. It returns to itself, so only a click reveals it.
  • Shared assets absolute, sibling pages relative — but only once you've confirmed you don't deploy under a subpath.
  • Verify on the output, in a browser's Network tab, not on the source.

"The build passed" means the things the build checks passed. If you don't know what's on that list, passing guarantees nothing. Knowing the list comes first; extending it comes after.