diff --git a/archivebox/core/templatetags/core_tags.py b/archivebox/core/templatetags/core_tags.py index 362dc6cd..7bc5b4d2 100644 --- a/archivebox/core/templatetags/core_tags.py +++ b/archivebox/core/templatetags/core_tags.py @@ -244,7 +244,7 @@ def _snapshot_url_for_context(context, snapshot, path: str = "") -> str: def _build_snapshot_files_url(snapshot_id: str, request=None, config=None, base_url: str | None = None) -> str: return ( - f"{base_url.rstrip('/')}/?files=1" + f"{base_url.rstrip('/')}/index.jsonl" if base_url else build_snapshot_url(str(snapshot_id), "/?files=1", request=request, config=config) ) diff --git a/archivebox/templates/core/snapshot.html b/archivebox/templates/core/snapshot.html index d48344a2..0b339970 100644 --- a/archivebox/templates/core/snapshot.html +++ b/archivebox/templates/core/snapshot.html @@ -1487,7 +1487,7 @@ sandbox="allow-same-origin allow-top-navigation-by-user-activation allow-scripts allow-forms" class="full-page-iframe" src="about:blank" - data-default-src="{% if best_result.path %}{% snapshot_preview_url snapshot best_result.path %}{% else %}{% snapshot_base_url snapshot %}/?files=1{% endif %}" + data-default-src="{% if best_result.path %}{% snapshot_preview_url snapshot best_result.path %}{% elif STATIC_EXPORT %}{% snapshot_url snapshot 'index.jsonl' %}{% else %}{% snapshot_base_url snapshot %}/?files=1{% endif %}" name="preview" loading="eager" fetchpriority="high"> @@ -1539,7 +1539,7 @@ const frame = document.getElementById('main-frame') if (!frame) return const snapshotBaseUrlEarly = "{% snapshot_base_url snapshot %}" - const snapshotFilesUrlEarly = `${snapshotBaseUrlEarly}/?files=1` + const snapshotFilesUrlEarly = "{% if STATIC_EXPORT %}{% snapshot_url snapshot 'index.jsonl' %}{% else %}{% snapshot_base_url snapshot %}/?files=1{% endif %}" const defaultSrc = frame.dataset.defaultSrc || snapshotFilesUrlEarly const rawHash = window.location.hash ? window.location.hash.slice(1) : '' @@ -1783,13 +1783,13 @@