From a8074ab7f6087a387f0a96cdb4dccda0ccf88036 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Tue, 5 Mar 2019 20:33:51 +0100 Subject: [PATCH] Hash custom.css version --- _templates/layout.html | 2 +- conf.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/_templates/layout.html b/_templates/layout.html index 6b1bc0373..cd47a88c2 100644 --- a/_templates/layout.html +++ b/_templates/layout.html @@ -5,7 +5,7 @@ {% endblock %} {%- block extrahead %} - + diff --git a/conf.py b/conf.py index b893a1f6e..bb2d56556 100644 --- a/conf.py +++ b/conf.py @@ -113,6 +113,9 @@ html_theme = 'alabaster' # documentation. # html_baseurl = os.getenv('BASE_URL', 'https://esphome.io') +with open('_static/custom.css', 'rb') as f: + custom_css_hash = "{:08X}".format(hash(f.read()) % 2**32) + html_theme_options = { # 'logo': 'logo-full.png', 'logo_name': False, @@ -122,6 +125,10 @@ html_theme_options = { 'show_powered_by': False, } +html_context = { + 'custom_css_hash': custom_css_hash, +} + html_logo = 'images/logo-text.svg' html_copy_source = True html_show_sourcelink = False