Skip to content

Conversation

@autonome
Copy link

@autonome autonome commented Feb 5, 2025

I forked and deployed, and after the first actions deployment I saw that the CSS was 404 because pathprefix was hardcoded.

@vercel
Copy link

vercel bot commented Feb 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
eleventy-base-blog ✅ Ready (Inspect) Visit Preview Feb 11, 2025 2:31pm

@zachleat
Copy link
Member

zachleat commented Feb 5, 2025

What process did you use to deploy?

I just tested this as-is, successfully: https://zachleat.github.io/eleventy-base-blog/ via https://github.com/zachleat/eleventy-base-blog

@zachleat zachleat added the open-question Further information is requested from the original poster. label Feb 5, 2025
@autonome
Copy link
Author

autonome commented Feb 5, 2025 via email

@autonome
Copy link
Author

Ok I tested with unmodified clone.

Leaving --pathprefix in package.json means that the default for the repo is to deploy to example.com/eleventy-base-blog.

This means that if you fork and deploy to a root path (eg example.com) the paths are incorrect out of the box - the URLs in the generated content point to example.com/eleventy-base-blog, which does not exist.

Deploying to /eleventy-base-blog seems extremely unlikely, outside of this demo blog. Most people will deploy to example.com/ or example.com/blog or something like that.

A better fork-and-go DX is to work out of the box regardless if the user deploys to a root path or a sub-directory.

I've updated the PR to remove the --pathprefix bits altogether.

I tested on both a root deploy and a subdirectory deploy and both worked fine.

@autonome
Copy link
Author

autonome commented Sep 7, 2025

@zachleat did that explanation make sense?

Another stab at explaining the difference:

The package.json commands currently assume the blog deploys to example.com/eleventy-base-blog.

Any fork not wanting to deploy to that path has to go make the changes manually.

After this change, not only does your example scenario still work, deploys also work out of the box with no modification for any permutation of domain, subdomain, path, etc.

  • example.com
  • {whatever}.example.com
  • example.com/{whatever}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-question Further information is requested from the original poster.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants