diff --git a/files/helpers/const.py b/files/helpers/const.py index 61c906678..026835f4a 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -7,6 +7,7 @@ from files.classes.sub import Sub from files.classes.marsey import Marsey from flask import request import tldextract +from os import path SITE = environ.get("DOMAIN", '').strip() SITE_NAME = environ.get("SITE_NAME", '').strip() @@ -933,4 +934,6 @@ SPAM_URL_SIMILARITY_THRESHOLD = float(environ.get("SPAM_URL_SIMILARITY_THRESHOLD SPAM_SIMILAR_COUNT_THRESHOLD = int(environ.get("SPAM_SIMILAR_COUNT_THRESHOLD", 10)) COMMENT_SPAM_SIMILAR_THRESHOLD = float(environ.get("COMMENT_SPAM_SIMILAR_THRESHOLD", 0.5)) COMMENT_SPAM_COUNT_THRESHOLD = int(environ.get("COMMENT_SPAM_COUNT_THRESHOLD", 10)) -DESCRIPTION = environ.get("DESCRIPTION", "rdrama.net caters to drama in all forms such as: Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™. There isn't drama we won't touch, and we want it all!").strip() \ No newline at end of file +DESCRIPTION = environ.get("DESCRIPTION", "rdrama.net caters to drama in all forms such as: Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™. There isn't drama we won't touch, and we want it all!").strip() + +has_sidebar = path.exists(f'files/templates/sidebar_{SITE_NAME}.html') \ No newline at end of file diff --git a/files/helpers/jinja2.py b/files/helpers/jinja2.py index 093e052ea..11c5547a9 100644 --- a/files/helpers/jinja2.py +++ b/files/helpers/jinja2.py @@ -58,4 +58,4 @@ def inject_constants(): "HOLE_NAME": HOLE_NAME, "HOLE_STYLE_FLAIR": HOLE_STYLE_FLAIR, "HOLE_REQUIRED": HOLE_REQUIRED, "LOTTERY_ENABLED": LOTTERY_ENABLED, "GUMROAD_LINK": GUMROAD_LINK, "DEFAULT_THEME": DEFAULT_THEME, "DESCRIPTION": DESCRIPTION, - "PROCOINS_ENABLED": PROCOINS_ENABLED,} + "PROCOINS_ENABLED": PROCOINS_ENABLED, "has_sidebar": has_sidebar} diff --git a/files/templates/default.html b/files/templates/default.html index b22eec9b7..e20235506 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -326,7 +326,7 @@ {% block sidebar %} - {% if home or sub and p %} + {% if has_sidebar %} {% include "sidebar_" + SITE_NAME + ".html" %} {% endif %} {% endblock %} @@ -375,6 +375,14 @@ +{% if SITE == 'funonly.xyz' %} + +{% endif %} + diff --git a/files/templates/header.html b/files/templates/header.html index d4a705f5b..ba5cdad72 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -281,7 +281,9 @@ {% endif %}
  • - {% include "sidebar_" + SITE_NAME + ".html" %} + {% if has_sidebar %} + {% include "sidebar_" + SITE_NAME + ".html" %} + {% endif %}
  • diff --git a/files/templates/sidebar.html b/files/templates/sidebar.html index 211bff1a8..d18b17c5c 100644 --- a/files/templates/sidebar.html +++ b/files/templates/sidebar.html @@ -14,7 +14,9 @@

    Sidebar

    {% endblock %} \ No newline at end of file