From 36c6f4ca3adfb237e1a4931563b782a4d7e7932a Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Fri, 20 Dec 2019 12:58:36 -0800 Subject: [PATCH] moving favicon(s) to config, allowing multiple favicons (#8856) * moving favicon to config, allowing multiple favicons * black... --- superset/config.py | 11 +++++++++++ superset/templates/superset/basic.html | 13 ++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/superset/config.py b/superset/config.py index 51b5e91bb..94ad24591 100644 --- a/superset/config.py +++ b/superset/config.py @@ -57,6 +57,17 @@ PACKAGE_DIR = os.path.join(BASE_DIR, "static", "assets") VERSION_INFO_FILE = os.path.join(PACKAGE_DIR, "version_info.json") PACKAGE_JSON_FILE = os.path.join(BASE_DIR, "assets", "package.json") +# Multiple favicons can be specified here. The "href" property +# is mandatory, but "sizes," "type," and "rel" are optional. +# For example: +# { +# "href":path/to/image.png", +# "sizes": "16x16", +# "type": "image/png" +# "rel": "icon" +# }, +FAVICONS = [{"href": "/static/assets/images/favicon.png"}] + def _try_json_readversion(filepath): try: diff --git a/superset/templates/superset/basic.html b/superset/templates/superset/basic.html index 6c1ff626c..922ca0c9f 100644 --- a/superset/templates/superset/basic.html +++ b/superset/templates/superset/basic.html @@ -16,7 +16,11 @@ specific language governing permissions and limitations under the License. #} + {% import 'appbuilder/general/lib.html' as lib %} + +{% set favicons = appbuilder.app.config['FAVICONS'] %} + @@ -30,7 +34,14 @@ {% block head_meta %}{% endblock %} {% block head_css %} - + {% for favicon in favicons %} + + {% endfor %}