bornhack / bma

BornHack Media Archive
BSD 3-Clause "New" or "Revised" License
1 stars 3 forks source link

load bootstrap locally #35

Closed tykling closed 6 months ago

tykling commented 2 years ago

figure out if django-bootstrap5 bundles the bootstrap css and js so it is possible to load them locally (not from a CDN), if not then include them manually in static_stc/js/vendor and static_src/css/vendor

0xUnicorn commented 2 years ago

css and js is separate, but they do use the bundle js for including popper. Not sure if overwriting the DEFAULT_BOOTSTRAP5 urls to will work.

BOOTSTRAP5_DEFAULTS = {
    "css_url": {
        "url": "https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css",
        "integrity": "sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx",
        "crossorigin": "anonymous",
    },
    "javascript_url": {
        "url": "https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js",
        "integrity": "sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa",
        "crossorigin": "anonymous",
    },

https://github.com/zostera/django-bootstrap5/blob/main/src/django_bootstrap5/core.py

tykling commented 2 years ago

sounds good, as long as it supports using relative urls. Just download the files and add them to the repo

tykling commented 6 months ago

done in fd6680e47a8c7d26e568828a9317f3adec6d8e44