Elderjs / elderjs

Elder.js is an opinionated static site generator and web framework for Svelte built with SEO in mind.
https://elderguide.com/tech/elderjs/
MIT License
2.11k stars 52 forks source link

Don't use a leading / if no serverPrefix is given #222

Closed msub2 closed 2 years ago

msub2 commented 2 years ago

For context, I'm using elderjs to deploy my site to a traditional server and Fleek, where the content is hosted on IPFS. Some IPFS gateways resolve IPNS through URLs such as https://ipfs.io/ipns/<url>, meaning if the CSS href is pointing to /_elderjs/assets/svelte-ddfc11db.css it attempts to read https://ipfs.io/_elderjs/assets/svelte-ddfc11db.css, which will fail. This just adds a check to see if serverPrefix is blank, in which case it does not use a leading /.

msub2 commented 2 years ago

Whoops, should've tested this a bit more, doesn't work on subpages