From ed13ec7655c3d262ef937d3d3a225a90f79e1150 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Sat, 30 Jan 2021 05:34:19 -0500 Subject: [PATCH] remove active theme --- archivebox/config.py | 6 ++---- archivebox/config_stubs.py | 1 - archivebox/core/settings.py | 8 +++----- archivebox/main.py | 3 +-- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/archivebox/config.py b/archivebox/config.py index dc014ed5..7fd4b2fc 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -76,7 +76,6 @@ CONFIG_SCHEMA: Dict[str, ConfigDefaultDict] = { 'PUBLIC_SNAPSHOTS': {'type': bool, 'default': True}, 'PUBLIC_ADD_VIEW': {'type': bool, 'default': False}, 'FOOTER_INFO': {'type': str, 'default': 'Content is hosted for personal archiving purposes only. Contact server owner for any takedown requests.'}, - 'ACTIVE_THEME': {'type': str, 'default': 'default'}, }, 'ARCHIVE_METHOD_TOGGLES': { @@ -204,12 +203,11 @@ def get_real_name(key: str) -> str: ################################ Constants ##################################### PACKAGE_DIR_NAME = 'archivebox' -TEMPLATES_DIR_NAME = 'themes' +TEMPLATES_DIR_NAME = 'templates' ARCHIVE_DIR_NAME = 'archive' SOURCES_DIR_NAME = 'sources' LOGS_DIR_NAME = 'logs' -STATIC_DIR_NAME = 'static' SQL_INDEX_FILENAME = 'index.sqlite3' JSON_INDEX_FILENAME = 'index.json' HTML_INDEX_FILENAME = 'index.html' @@ -702,7 +700,7 @@ def get_code_locations(config: ConfigDict) -> SimpleConfigValueDict: 'TEMPLATES_DIR': { 'path': (config['TEMPLATES_DIR']).resolve(), 'enabled': True, - 'is_valid': (config['TEMPLATES_DIR'] / config['ACTIVE_THEME'] / 'static').exists(), + 'is_valid': (config['TEMPLATES_DIR'] / 'static').exists(), }, # 'NODE_MODULES_DIR': { # 'path': , diff --git a/archivebox/config_stubs.py b/archivebox/config_stubs.py index 988f58a1..f9c22a0c 100644 --- a/archivebox/config_stubs.py +++ b/archivebox/config_stubs.py @@ -50,7 +50,6 @@ class ConfigDict(BaseConfig, total=False): PUBLIC_INDEX: bool PUBLIC_SNAPSHOTS: bool FOOTER_INFO: str - ACTIVE_THEME: str SAVE_TITLE: bool SAVE_FAVICON: bool diff --git a/archivebox/core/settings.py b/archivebox/core/settings.py index bfc0cdc3..bcf9c073 100644 --- a/archivebox/core/settings.py +++ b/archivebox/core/settings.py @@ -11,7 +11,6 @@ from ..config import ( SECRET_KEY, ALLOWED_HOSTS, PACKAGE_DIR, - ACTIVE_THEME, TEMPLATES_DIR_NAME, SQL_INDEX_FILENAME, OUTPUT_DIR, @@ -69,13 +68,12 @@ AUTHENTICATION_BACKENDS = [ STATIC_URL = '/static/' STATICFILES_DIRS = [ - str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / ACTIVE_THEME / 'static'), - str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / 'default' / 'static'), + str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / 'static'), ] TEMPLATE_DIRS = [ - str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / ACTIVE_THEME), - str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / 'default'), + str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / 'core'), + str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / 'admin'), str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME), ] diff --git a/archivebox/main.py b/archivebox/main.py index c666f5d6..c55a2c04 100644 --- a/archivebox/main.py +++ b/archivebox/main.py @@ -79,7 +79,6 @@ from .config import ( ARCHIVE_DIR_NAME, SOURCES_DIR_NAME, LOGS_DIR_NAME, - STATIC_DIR_NAME, JSON_INDEX_FILENAME, HTML_INDEX_FILENAME, SQL_INDEX_FILENAME, @@ -125,10 +124,10 @@ ALLOWED_IN_OUTPUT_DIR = { '.virtualenv', 'node_modules', 'package-lock.json', + 'static', ARCHIVE_DIR_NAME, SOURCES_DIR_NAME, LOGS_DIR_NAME, - STATIC_DIR_NAME, SQL_INDEX_FILENAME, JSON_INDEX_FILENAME, HTML_INDEX_FILENAME,