Elderjs / elderjs

Elder.js is an opinionated static site generator and web framework for Svelte built with SEO in mind.

Home Page:https://elderguide.com/tech/elderjs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build output doesn't work locally by default (href <link> are absolute)

Stijn-B opened this issue · comments

The href attribute of <link> tags is an absolute url like href=/path/to/file. As a result those files aren't loaded when opening the build result (public/index.html) locally during development. This is fixed by making the urls relative like href=./path/to/file.

I don't know if making the urls relative during building would lead to unwanted effects in production. If not, it might be a nice quality of life improvent; you can check locally whether your build output behaves as expected.
(Personally, when opening the build output, at first I thought I did something wrong because the css styling didn't load but it was just this detail)

commented

If you use Elderjs/template, try the serve command:
https://github.com/Elderjs/template/blob/8d3ba83efa9c14e70fc69cb4c30d9d0c42ca8483/package.json#L12

IIRC, path logic are located everywhere so this feature may require some refactoring.