Search code examples
javascriptstatic-filesskel

How to use skel.js with a prefix for the static files?


I use a template with skel.js and moved the "css" and "js" folders into a subfolder "static" and adapted all paths in the html files and in "init.js".

When I load the page, skel still tries to load the css files from "css/" instead of "static/css/" and I cannot find where it constructs the path from if not from the values in init.js.

The CSS and JS files can all be found at the correct paths and I use the full url in the HTML and init.js files as the "/static/" folder lies on another domain. The javascript files are loaded correctly and the css files can be loaded i.e. in the noscript tags without any problem. Only the javascript loading the stylesheets constructs wrong paths.


Solution

  • The solution seems to be to set the prefix property in init.js. This invalidates the href attributes of the breakpoints, so you need to name the css files like the keys of the breakpoint dictionary, i.e. style-global.css.

    I do not know how a prefix and custom href attributes can be used together, I went with naming the css files the correct way for the generated filenames.