Unit 08 · lesson

Production URLs and Base Paths

Production is where hidden URL assumptions become visible.

Project-site example

A repository site may be served under a path like:

https://student.github.io/my-portfolio/

If your source hard-codes:

<a href="/projects/">Projects</a>

that link begins at the domain root:

https://student.github.io/projects/

not necessarily your repository subpath.

Use Jekyll's URL helpers and your url/baseurl configuration deliberately.

Check the generated HTML from the production build and the public browser request.

Absolute vs relative concerns

Different contexts need different output:

  • internal page links;
  • asset links;
  • canonical/social metadata;
  • external links.

Do not force one URL pattern into every purpose.

Failure pattern

localhost: PASS
GitHub Pages HTML: loads
CSS/images/project links: FAIL

That pattern strongly suggests generated addressing/base-path assumptions.

Fix source, not production output

Repair:

  • template URL generation;
  • baseurl/url config;
  • permalink assumptions;

then rebuild/redeploy.

Checkpoint

Pick one production link and trace:

source Liquid/path
→ production config
→ generated href/src
→ public browser request
→ target