-
Notifications
You must be signed in to change notification settings - Fork 195
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
daux serve doesn't work with custom themes #119
Comments
I was just about to report this, myself. Are you using an equivalent structure to the Daux theme i.e. JavaScript files in a |
Initially I thought I may have done something wrong, so I tried copying the Interesting that it looks like it's serving files. I don't know enough about the internals to trace the server process without literally starting at the very beginning of the script, so I thought that by not logging the file it wasn't even getting the request. |
It works if you put your theme in |
Hi, to successfully use a custom theme you need these things :
If by following this it works, can you tell me what you missed and what I should add/change/clarify in the documentation ? |
Hi, it doesn't work for me following your steps. Stylesheets in custom themes are served with the wrong mime even if i duplicate the default theme Resource interpreted as Stylesheet but transferred with MIME type text/plain: "http://localhost:8085/themes/tucano/css/theme-red.min.css". |
I concur with @jbllm - following those instructions results in correct content being shown, but with no styles. This message appears in the Chrome developer console:
I do want to stress that |
Here's some interesting info that at least seems to be the root cause of the problem, i.e. why only built-in themes are served properly using the built-in web server. Haven't figured out how to fix yet, but maybe these reverse-engineering notes will help. Stepping through the entire process with the debugger reveals that serving static assets for built-in themes follows an entirely different (and much simplified) code path from custom themes. This is caused by the router script itself. That script causes any file that exists relative to the (Side note - the way this check works will also cause a separate bug - if your custom theme is called (Other side note - this also means that the entire documentation tree, processors and everything, is regenerated for each asset request. Probably not really a big deal, since performance while working on docs can't be that bad, but interesting to note nonetheless, as serving a site with a custom theme will be slower than one with the default theme.) Daux handles custom themes by crafting its own response containing the asset file in question. However, for reasons I can't figure out, |
This seems to be related to using the deprecated |
This is on purpose as the serve option is meant for development, production should be done with the generated version. Although that would work for small documentation, it definitely wouldn't with big documentations. |
When using a custom theme not in the
vendor/daux/daux.io/themes
directory, the resulting page has no stylesheets or javascripts applied or run. The console output also does not show those files being served as it usually does when a default theme is used and the browser requests stylesheets etc.Custom themes do work when using
daux generate
, it is onlydaux serve
that does not use them.The text was updated successfully, but these errors were encountered: