-
-
Notifications
You must be signed in to change notification settings - Fork 713
Remove base repo pathprefix so deploys work out of the box #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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
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.
@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}
I forked and deployed, and after the first actions deployment I saw that the CSS was 404 because
pathprefix
was hardcoded.