freedit needs to be restarted every time the css style is modified to see the effect, is there any other way to solve this problem?

โš“ Dev    ๐Ÿ“… 2023-06-24    ๐Ÿ‘ค Ryza    ๐Ÿ‘๏ธ 185      



This post was published 95 days ago. The infomation described in this article may have changed.

If it is just a modification of the elements and css in the html, it must be recompiled is there any way to solve this problem? @freedit

๐Ÿท๏ธ freedit

freedit    2023-06-24 ๐Ÿ‘ ๐Ÿ‘Ž

Cargo watch might be helpful but itโ€™s not easy to solve it unless we replace askama


freedit    2023-06-25 ๐Ÿ‘ ๐Ÿ‘Ž

There is another way:

just add

 let mut router_static = Router::new()
        .route("/static/style.css", get(style))
        .nest_service("/static/avatars", ServeDir::new(&CONFIG.avatars_path))
        .nest_service("/static/inn_icons", ServeDir::new(&CONFIG.inn_icons_path))
        .nest_service("/static/upload", ServeDir::new(&CONFIG.upload_path))
        .nest_service("/css", ServeDir::new("./static/css"));

And then you will get /css/main.css in static css folder.


freedit    2023-06-25 ๐Ÿ‘ ๐Ÿ‘Ž

We bundled css files in binary so the instance maintainers donโ€™t have to get these static files. We prefer easy to deploy than easy to develop.