From 46c6ee901706d1fda991cd72ce23f3f69987a53d Mon Sep 17 00:00:00 2001 From: Moritz Schlarb Date: Fri, 1 Oct 2021 11:35:05 +0200 Subject: [PATCH] Add SITE_DESCRIPTION config variable Which gets used in the html header tag. --- seahub/base/context_processors.py | 3 ++- seahub/settings.py | 3 +++ seahub/templates/base.html | 1 + seahub/templates/base_for_react.html | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/seahub/base/context_processors.py b/seahub/base/context_processors.py index 8db5cee521..1a23a26d16 100644 --- a/seahub/base/context_processors.py +++ b/seahub/base/context_processors.py @@ -17,7 +17,7 @@ from constance import config import seaserv -from seahub.settings import SEAFILE_VERSION, \ +from seahub.settings import SEAFILE_VERSION, SITE_DESCRIPTION, \ MAX_FILE_NAME, LOGO_PATH, BRANDING_CSS, LOGO_WIDTH, LOGO_HEIGHT,\ SHOW_REPO_DOWNLOAD_BUTTON, SITE_ROOT, ENABLE_GUEST_INVITATION, \ FAVICON_PATH, THUMBNAIL_SIZE_FOR_ORIGINAL, \ @@ -104,6 +104,7 @@ def base(request): result = { 'seafile_version': SEAFILE_VERSION, 'site_title': config.SITE_TITLE, + 'site_description': SITE_DESCRIPTION, 'branding_css': BRANDING_CSS, 'enable_branding_css': config.ENABLE_BRANDING_CSS, 'favicon_path': favicon_path, diff --git a/seahub/settings.py b/seahub/settings.py index df047a5ad2..380aae6088 100644 --- a/seahub/settings.py +++ b/seahub/settings.py @@ -550,6 +550,9 @@ INIT_PASSWD = genpassword # browser tab title SITE_TITLE = 'Private Seafile' +# html head meta tag for search engine preview text +SITE_DESCRIPTION = '' + # Base name used in email sending SITE_NAME = 'Seafile' diff --git a/seahub/templates/base.html b/seahub/templates/base.html index 075e425765..f05f2ad7de 100644 --- a/seahub/templates/base.html +++ b/seahub/templates/base.html @@ -6,6 +6,7 @@ {% block sub_title %}{% endblock %}{{ site_title }} +{% if site_description != '' %}{% endif %} {% block viewport %} {% endblock %} diff --git a/seahub/templates/base_for_react.html b/seahub/templates/base_for_react.html index b2a3404a99..4140f170b1 100644 --- a/seahub/templates/base_for_react.html +++ b/seahub/templates/base_for_react.html @@ -7,6 +7,7 @@ {% block sub_title %}{% endblock %}{{ site_title }} +{% if site_description != '' %}{% endif %} {% block viewport %} {% endblock %}