From d2e9e21e198192124bcb0f9ca6611641354f4cfa Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Mon, 28 Aug 2023 23:39:34 +0400 Subject: [PATCH] Add config options PREVIEW_MEDIA, PREVIEW_GIT --- archivebox/config.py | 2 ++ archivebox/index/html.py | 4 ++++ archivebox/templates/core/snapshot.html | 4 ++++ docker-compose.yml | 8 +++++--- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/archivebox/config.py b/archivebox/config.py index fb7b96b3..7a12b24f 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -106,6 +106,8 @@ CONFIG_SCHEMA: Dict[str, ConfigDefaultDict] = { 'LOGOUT_REDIRECT_URL': {'type': str, 'default': '/'}, 'PREVIEW_ARCHIVE_DOT_ORG': {'type': bool, 'default': True}, 'PREVIEW_ORIGINALS': {'type': bool, 'default': True}, + 'PREVIEW_MEDIA': {'type': bool, 'default': True}, + 'PREVIEW_GIT': {'type': bool, 'default': True}, 'LOGOUT_REDIRECT_URL': {'type': str, 'default': '/'}, }, diff --git a/archivebox/index/html.py b/archivebox/index/html.py index a81850cb..334efc1c 100644 --- a/archivebox/index/html.py +++ b/archivebox/index/html.py @@ -25,6 +25,8 @@ from ..config import ( HTML_INDEX_FILENAME, PREVIEW_ARCHIVE_DOT_ORG, PREVIEW_ORIGINALS, + PREVIEW_MEDIA, + PREVIEW_GIT, ) MAIN_INDEX_TEMPLATE = 'static_index.html' @@ -107,6 +109,8 @@ def link_details_template(link: Link) -> str: 'oldest_archive_date': ts_to_date_str(link.oldest_archive_date), 'PREVIEW_ARCHIVE_DOT_ORG': PREVIEW_ARCHIVE_DOT_ORG, 'PREVIEW_ORIGINALS': PREVIEW_ORIGINALS, + 'PREVIEW_MEDIA': PREVIEW_MEDIA, + 'PREVIEW_GIT': PREVIEW_GIT, }) @enforce_types diff --git a/archivebox/templates/core/snapshot.html b/archivebox/templates/core/snapshot.html index 3524dd3a..00d5a94e 100644 --- a/archivebox/templates/core/snapshot.html +++ b/archivebox/templates/core/snapshot.html @@ -241,6 +241,7 @@ + {% if PREVIEW_MEDIA %}
@@ -257,6 +258,8 @@
+ {% endif %} + {% if PREVIEW_GIT %}
@@ -273,6 +276,7 @@
+ {% endif %} diff --git a/docker-compose.yml b/docker-compose.yml index c3820e29..e5d87334 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,8 +16,10 @@ services: - PUID=1000 - PGID=1000 # Extractors - - USE_YOUTUBEDL=False - USE_GIT=False - - SAVE_GIT=False - - SAVE_MEDIA=False + - USE_YOUTUBEDL=False - SAVE_ARCHIVE_DOT_ORG=False + - SAVE_MEDIA=False + - SAVE_GIT=False + - PREVIEW_MEDIA=False + - PREVIEW_GIT=False