Include sha1 hash in /static/app.css URL

This means that when Datasette's CSS changes the new CSS will be loaded
even though browsers may have cached the previous version.

Closes #154
This commit is contained in:
Simon Willison 2017-12-08 19:10:09 -08:00
commit 16dfccb1c5
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
2 changed files with 14 additions and 2 deletions

View file

@ -2,7 +2,7 @@
<html>
<head>
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" href="/-/static/app.css">
<link rel="stylesheet" href="/-/static/app.css?{{ app_css_hash }}">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{% for url in extra_css_urls %}
<link rel="stylesheet" href="{{ url.url }}"{% if url.sri %} integrity="{{ url.sri }}" crossorigin="anonymous"{% endif %}>