cargo-web icon indicating copy to clipboard operation
cargo-web copied to clipboard

Autogenerated index.html not including static/style.css

Open LordZane opened this issue 6 years ago • 6 comments

LordZane avatar May 05 '18 17:05 LordZane

I don't think cargo-web should generate more than a simple index.html like what it do right now! It requires more work in cargo-web but not produce any actual benefit. If you have a styles.css, just create your own index.html to include your .css. You just do this only one time for a project. It is not a very difficult or boring-repetitive task to require a tool.

limira avatar May 06 '18 16:05 limira

@LordZane Could you explain in more detail what exactly would you want here? What purpose such a CSS file would serve? What would be in it?

koute avatar May 06 '18 21:05 koute

I meant that when cargo-web generated an index.html for me, I expected it to include the style.css file I had in the static folder, not just copy the style.css over. If you don't want to add support for that, it's fine, but it just deviates from what I expected to occur

LordZane avatar May 06 '18 21:05 LordZane

You want it to take the style.css and paste it inside the index.html inline?

koute avatar May 06 '18 21:05 koute

No, just add <link rel="stylesheet" type="text/css" href="style.css" /> to the html. Im saying that since style.css is automatically copied when doing cargo web deploy, I expected the generated html file to include it

LordZane avatar May 06 '18 21:05 LordZane

I don't think this is a good idea. In my case I want to run a minifier over my CSS and only link the result of that. It would be very confusing if cargo-web were to auto-include random stylesheets (even though it's unlikely that i'd have the source files in ./static/ then)

untitaker avatar Sep 17 '18 19:09 untitaker