{% load static %}
{% if scholar_asset_stage == "head" %}
{% comment %}
scitex-app's `stx-mount` contract: the server declares where this app
is mounted so client code never has to guess. Always ends in "/", so
JS joins endpoint names WITHOUT a leading slash and never normalises.
Emitted here rather than by the SDK because `scitex_editor_page` --
which injects it automatically -- serves built SPA shells, and this is
a Django-rendered template.
{% endcomment %}
{% comment %}
NO |default FILTER. The root prefix is "" under scitex-app >= 0.8.0,
and Django's `default` fires on FALSY -- so `|default:'/'` silently
rewrote the correct "" back into the old "/", making every root
request build "//api/..." : protocol-relative, off-origin. That is
the exact failure the convention reversal exists to prevent, and it
passed a test asserting the OLD value.
This block used to be `{# ... #}`, which DJANGO ONLY STRIPS ON A
SINGLE LINE -- a multi-line `{# #}` is emitted verbatim into the
page. It was rendering as visible text at the top of the UI; the
operator saw it in the browser before any test did.
{% endcomment %}
{% comment %}
PWA (installable): scholar's own manifest + theme + iOS icon. The shared
shell deliberately stays PWA-agnostic (every leaf has its own name/icons),
so the app declares its own. No service worker: the standalone app is
stateless and a cache layer would risk stale-data surprises — installable
is the goal here, offline is a separate decision.
{% endcomment %}
{% elif scholar_asset_stage == "scripts" %}
{{ scholar_i18n|json_script:"SCHOLAR_I18N" }}
{% endif %}