Elderjs / template

Elder.js template project. It is part template, part tutorial. Dive in!
https://elderjs.pages.dev/
MIT License
113 stars 32 forks source link

Make assets location portable #12

Closed akvadrako closed 4 years ago

akvadrako commented 4 years ago

One of the first things I did when starting with this template is to move the public folder, however that broke because it's hard-coded in Layout.svelte.

This patch means the URL path to the assets folder is always computed as the relative path from public to assets. This is more correct than before but honestly seems a little fragile – if it's always assumed the assets are under the public folder (i.e. not in a CDN), then shouldn't the assets path be relative to the public root, like this:

  locations: {
    public: './public/',
    assets: '/static',
nickreese commented 4 years ago

@akvadrako Thanks!

nickreese commented 4 years ago

@akvadrako Having reviewed this, this should be configurable but having it outside the public directory is an issue if you want to use Elder.js many of the ways documented. Going to change your var to a const but makes sense. Thank you.