Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
autonome wants to merge 2 commits into 11ty:main
base: main
Choose a base branch
Loading
from autonome:remove-prefixpath

Conversation

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
edited
Loading

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

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
Copy link
Author

autonome commented Feb 5, 2025 via email

Hmm, I made various other changes when upgrading to the v3-based version. Perhaps something else caused `/eleventy-base-blog/` to be in the generated CSS URLs, but removing that from the `pathprefix` argument fixed it. But the process was basically: - cloned locally - made changes - rename the action (s/.sample//) - push to origin
...
On Wed, Feb 5, 2025, at 21:18, Zach Leatherman wrote: 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 — Reply to this email directly, view it on GitHub <#201 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAMHNZLOMOV3VW6EGKZYG32OJWYFAVCNFSM6AAAAABWRAGVYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZXHEZTONJZGQ>. You are receiving this because you authored the thread.Message ID: ***@***.***>

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.

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

Reviewers

No reviews

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /