{% comment %} Emitted by {% frontend_head %}. Renders nothing unless a GDAPS frontend engine is active, so the tag is safe to leave in a base template that is also used by projects without a frontend. The import map must be inline: external import maps are not supported by browsers. Under a Content-Security-Policy this means script-src has to allow it — either via the nonce below (from django-csp or from Django's own CSP, see the frontend_head tag) or by whitelisting the map's hash. Without it the browser drops the map and the frontend does not boot at all. See docs/advanced/frontend.md. The import map must also come before the first module script on the page, and there may only be one per document — which is why GDAPS owns it. The modulepreload links come *after* the map, not before: a preloaded module's own imports are bare specifiers, which the browser can only resolve once the map is in hand. They fall under script-src like the shell does, but a link element carries no nonce. A library entry whose manifest records a hash gets it as integrity="…" here and in the map's "integrity" section. The stylesheet links belong to the shared libraries: their builds record what CSS they emitted, so the host does not have to hardcode paths that a hashing static files storage renames. They are ordinary external resources — the script nonce does not apply to them, but style-src must allow the static origin. {% endcomment %} {% if enabled %} {% for preload in preloads %} {% endfor %}{% for stylesheet in stylesheets %} {% endfor %} {{ config|json_script:"gdaps-frontend-config" }} {% endif %}