Skip to content
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

Remove base repo pathprefix so deploys work out of the box #201

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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.

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.

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