bookwyrm-social / bookwyrm

Social reading and reviewing, decentralized with ActivityPub
http://joinbookwyrm.com/
Other
2.27k stars 266 forks source link

Add STATIC_ROOT to .env.example to resolve static resource loading issues #3449

Open Guanchishan opened 1 month ago

Guanchishan commented 1 month ago

Is your feature request related to a problem? Please describe. Yes, the absence of a STATIC_ROOT setting in .env.example can lead to broken CSS, particularly after logging in, where the website's static resources (such as CSS and JavaScript) fail to load properly. This results in a severely degraded user interface.

Describe the solution you'd like Add STATIC_ROOT=static/ to the .env.example file to provide a clear path for static resource collection. This ensures that all users, regardless of their environment setup, can correctly load CSS and other static files without manual intervention.

Describe alternatives you've considered

Additional context

I recently migrated my service to the current environment, and I ensured that all recommended update procedures outlined in the BookWyrm documentation were strictly followed.

Initially, after properly configuring Nginx, the CSS for the site appeared normal for users who were not logged in. However, upon logging in, the CSS became disorganized. This issue was only resolved after configuring STATIC_ROOT=static/.

Interestingly, although this was not directly related to the issue, I also found that after configuring Nginx, other images on the website displayed correctly, but the site icon did not appear. It was only after adding MEDIA_ROOT=images/ that the site icon became visible. This was an intriguing discovery.

Guanchishan commented 1 month ago

See also: https://github.com/bookwyrm-social/bookwyrm/pull/3452