1
0
Fork 0

remove active theme

This commit is contained in:
Nick Sweeting 2021-01-30 05:34:19 -05:00
parent cddbd8f63e
commit ed13ec7655
4 changed files with 6 additions and 12 deletions

View file

@ -76,7 +76,6 @@ CONFIG_SCHEMA: Dict[str, ConfigDefaultDict] = {
'PUBLIC_SNAPSHOTS': {'type': bool, 'default': True}, 'PUBLIC_SNAPSHOTS': {'type': bool, 'default': True},
'PUBLIC_ADD_VIEW': {'type': bool, 'default': False}, '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.'}, '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': { 'ARCHIVE_METHOD_TOGGLES': {
@ -204,12 +203,11 @@ def get_real_name(key: str) -> str:
################################ Constants ##################################### ################################ Constants #####################################
PACKAGE_DIR_NAME = 'archivebox' PACKAGE_DIR_NAME = 'archivebox'
TEMPLATES_DIR_NAME = 'themes' TEMPLATES_DIR_NAME = 'templates'
ARCHIVE_DIR_NAME = 'archive' ARCHIVE_DIR_NAME = 'archive'
SOURCES_DIR_NAME = 'sources' SOURCES_DIR_NAME = 'sources'
LOGS_DIR_NAME = 'logs' LOGS_DIR_NAME = 'logs'
STATIC_DIR_NAME = 'static'
SQL_INDEX_FILENAME = 'index.sqlite3' SQL_INDEX_FILENAME = 'index.sqlite3'
JSON_INDEX_FILENAME = 'index.json' JSON_INDEX_FILENAME = 'index.json'
HTML_INDEX_FILENAME = 'index.html' HTML_INDEX_FILENAME = 'index.html'
@ -702,7 +700,7 @@ def get_code_locations(config: ConfigDict) -> SimpleConfigValueDict:
'TEMPLATES_DIR': { 'TEMPLATES_DIR': {
'path': (config['TEMPLATES_DIR']).resolve(), 'path': (config['TEMPLATES_DIR']).resolve(),
'enabled': True, 'enabled': True,
'is_valid': (config['TEMPLATES_DIR'] / config['ACTIVE_THEME'] / 'static').exists(), 'is_valid': (config['TEMPLATES_DIR'] / 'static').exists(),
}, },
# 'NODE_MODULES_DIR': { # 'NODE_MODULES_DIR': {
# 'path': , # 'path': ,

View file

@ -50,7 +50,6 @@ class ConfigDict(BaseConfig, total=False):
PUBLIC_INDEX: bool PUBLIC_INDEX: bool
PUBLIC_SNAPSHOTS: bool PUBLIC_SNAPSHOTS: bool
FOOTER_INFO: str FOOTER_INFO: str
ACTIVE_THEME: str
SAVE_TITLE: bool SAVE_TITLE: bool
SAVE_FAVICON: bool SAVE_FAVICON: bool

View file

@ -11,7 +11,6 @@ from ..config import (
SECRET_KEY, SECRET_KEY,
ALLOWED_HOSTS, ALLOWED_HOSTS,
PACKAGE_DIR, PACKAGE_DIR,
ACTIVE_THEME,
TEMPLATES_DIR_NAME, TEMPLATES_DIR_NAME,
SQL_INDEX_FILENAME, SQL_INDEX_FILENAME,
OUTPUT_DIR, OUTPUT_DIR,
@ -69,13 +68,12 @@ AUTHENTICATION_BACKENDS = [
STATIC_URL = '/static/' STATIC_URL = '/static/'
STATICFILES_DIRS = [ STATICFILES_DIRS = [
str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / ACTIVE_THEME / 'static'), str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / 'static'),
str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / 'default' / 'static'),
] ]
TEMPLATE_DIRS = [ TEMPLATE_DIRS = [
str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / ACTIVE_THEME), str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / 'core'),
str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / 'default'), str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME / 'admin'),
str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME), str(Path(PACKAGE_DIR) / TEMPLATES_DIR_NAME),
] ]

View file

@ -79,7 +79,6 @@ from .config import (
ARCHIVE_DIR_NAME, ARCHIVE_DIR_NAME,
SOURCES_DIR_NAME, SOURCES_DIR_NAME,
LOGS_DIR_NAME, LOGS_DIR_NAME,
STATIC_DIR_NAME,
JSON_INDEX_FILENAME, JSON_INDEX_FILENAME,
HTML_INDEX_FILENAME, HTML_INDEX_FILENAME,
SQL_INDEX_FILENAME, SQL_INDEX_FILENAME,
@ -125,10 +124,10 @@ ALLOWED_IN_OUTPUT_DIR = {
'.virtualenv', '.virtualenv',
'node_modules', 'node_modules',
'package-lock.json', 'package-lock.json',
'static',
ARCHIVE_DIR_NAME, ARCHIVE_DIR_NAME,
SOURCES_DIR_NAME, SOURCES_DIR_NAME,
LOGS_DIR_NAME, LOGS_DIR_NAME,
STATIC_DIR_NAME,
SQL_INDEX_FILENAME, SQL_INDEX_FILENAME,
JSON_INDEX_FILENAME, JSON_INDEX_FILENAME,
HTML_INDEX_FILENAME, HTML_INDEX_FILENAME,