scidsg / hushline

Hush Line connects whistleblowers with organizations and people who can help.
https://hushline.app
GNU Affero General Public License v3.0
77 stars 21 forks source link

Use async/defer for JS script tags #683

Open brassy-endomorph opened 1 month ago

brassy-endomorph commented 1 month ago

Is your feature request related to a problem? Please describe.

We are using an antiquated practice of loading scripts at the end of the HTML document.

https://github.com/scidsg/hushline/blob/ce44578e1a2902c2df724c3cf173a35a0aaff16a/hushline/templates/base.html#L202-L206

Describe the solution you'd like

Move the scripts to the <head> and use the async and defer attribute to modify the behavior so that scripts can start being loaded earlier in the document.