diff --git a/archivebox/config.py b/archivebox/config.py index 21e48ff2..3da4b304 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -94,6 +94,7 @@ CONFIG_SCHEMA: Dict[str, ConfigDefaultDict] = { 'SNAPSHOTS_PER_PAGE': {'type': int, 'default': 40}, 'CUSTOM_TEMPLATES_DIR': {'type': str, 'default': None}, 'TIME_ZONE': {'type': str, 'default': 'UTC'}, + 'PREVIEW_ORIGINALS': {'type': bool, 'default': True}, }, 'ARCHIVE_METHOD_TOGGLES': { diff --git a/archivebox/index/html.py b/archivebox/index/html.py index d45f66ea..66e26fab 100644 --- a/archivebox/index/html.py +++ b/archivebox/index/html.py @@ -24,6 +24,7 @@ from ..config import ( FOOTER_INFO, HTML_INDEX_FILENAME, SAVE_ARCHIVE_DOT_ORG, + PREVIEW_ORIGINALS, ) MAIN_INDEX_TEMPLATE = 'static_index.html' @@ -105,6 +106,7 @@ def link_details_template(link: Link) -> str: 'status_color': 'success' if link.is_archived else 'danger', 'oldest_archive_date': ts_to_date_str(link.oldest_archive_date), 'SAVE_ARCHIVE_DOT_ORG': SAVE_ARCHIVE_DOT_ORG, + 'PREVIEW_ORIGINALS': PREVIEW_ORIGINALS, }) @enforce_types diff --git a/archivebox/templates/core/snapshot.html b/archivebox/templates/core/snapshot.html index ccb74227..9b8b1e53 100644 --- a/archivebox/templates/core/snapshot.html +++ b/archivebox/templates/core/snapshot.html @@ -414,6 +414,7 @@ {% endif %} + {% if PREVIEW_ORIGINALS %}
@@ -427,6 +428,7 @@
+ {{% endif %}}