From 15cab52d5460a02f3a0944ff95ebf898bb015071 Mon Sep 17 00:00:00 2001 From: Sunpy Date: Tue, 12 Feb 2019 17:35:58 +0100 Subject: [PATCH] True static items will be in const (due to anti-cache workaround) --- main.py | 8 ++++---- static/{ => const}/css/bootstrap-grid.css | 0 static/{ => const}/css/bootstrap-grid.css.map | 0 static/{ => const}/css/bootstrap-grid.min.css | 0 static/{ => const}/css/bootstrap-grid.min.css.map | 0 static/{ => const}/css/bootstrap-reboot.css | 0 static/{ => const}/css/bootstrap-reboot.css.map | 0 static/{ => const}/css/bootstrap-reboot.min.css | 0 static/{ => const}/css/bootstrap-reboot.min.css.map | 0 static/{ => const}/css/bootstrap.css | 0 static/{ => const}/css/bootstrap.css.map | 0 static/{ => const}/css/bootstrap.min.css | 0 static/{ => const}/css/bootstrap.min.css.map | 0 static/{ => const}/js/bootstrap.bundle.js | 0 static/{ => const}/js/bootstrap.bundle.js.map | 0 static/{ => const}/js/bootstrap.bundle.min.js | 0 static/{ => const}/js/bootstrap.bundle.min.js.map | 0 static/{ => const}/js/bootstrap.js | 0 static/{ => const}/js/bootstrap.js.map | 0 static/{ => const}/js/bootstrap.min.js | 0 static/{ => const}/js/bootstrap.min.js.map | 0 static/{ => const}/js/jquery-3.3.1.slim.min.js | 0 static/{ => const}/js/jquery-3.3.1.slim.min.map | 0 static/{ => const}/js/popper.min.js | 0 templates/layout/bootstrap.html | 8 ++++---- 25 files changed, 8 insertions(+), 8 deletions(-) rename static/{ => const}/css/bootstrap-grid.css (100%) rename static/{ => const}/css/bootstrap-grid.css.map (100%) rename static/{ => const}/css/bootstrap-grid.min.css (100%) rename static/{ => const}/css/bootstrap-grid.min.css.map (100%) rename static/{ => const}/css/bootstrap-reboot.css (100%) rename static/{ => const}/css/bootstrap-reboot.css.map (100%) rename static/{ => const}/css/bootstrap-reboot.min.css (100%) rename static/{ => const}/css/bootstrap-reboot.min.css.map (100%) rename static/{ => const}/css/bootstrap.css (100%) rename static/{ => const}/css/bootstrap.css.map (100%) rename static/{ => const}/css/bootstrap.min.css (100%) rename static/{ => const}/css/bootstrap.min.css.map (100%) rename static/{ => const}/js/bootstrap.bundle.js (100%) rename static/{ => const}/js/bootstrap.bundle.js.map (100%) rename static/{ => const}/js/bootstrap.bundle.min.js (100%) rename static/{ => const}/js/bootstrap.bundle.min.js.map (100%) rename static/{ => const}/js/bootstrap.js (100%) rename static/{ => const}/js/bootstrap.js.map (100%) rename static/{ => const}/js/bootstrap.min.js (100%) rename static/{ => const}/js/bootstrap.min.js.map (100%) rename static/{ => const}/js/jquery-3.3.1.slim.min.js (100%) rename static/{ => const}/js/jquery-3.3.1.slim.min.map (100%) rename static/{ => const}/js/popper.min.js (100%) diff --git a/main.py b/main.py index 819b780..034a3c5 100644 --- a/main.py +++ b/main.py @@ -17,12 +17,12 @@ if glob.config["disable-static-cache"]: return dict(url_for=dated_url_for) def dated_url_for(endpoint, **values): - if endpoint == 'static': - filename = values.get('filename', None) - if filename: + if endpoint == "static": + filename = values.get("filename", None) + if filename and not filename.startswith("const/"): file_path = os.path.join(glob.app.root_path, endpoint, filename) - values['q'] = int(os.stat(file_path).st_mtime) + values["q"] = int(os.stat(file_path).st_mtime) return url_for(endpoint, **values) if __name__ == "__main__": diff --git a/static/css/bootstrap-grid.css b/static/const/css/bootstrap-grid.css similarity index 100% rename from static/css/bootstrap-grid.css rename to static/const/css/bootstrap-grid.css diff --git a/static/css/bootstrap-grid.css.map b/static/const/css/bootstrap-grid.css.map similarity index 100% rename from static/css/bootstrap-grid.css.map rename to static/const/css/bootstrap-grid.css.map diff --git a/static/css/bootstrap-grid.min.css b/static/const/css/bootstrap-grid.min.css similarity index 100% rename from static/css/bootstrap-grid.min.css rename to static/const/css/bootstrap-grid.min.css diff --git a/static/css/bootstrap-grid.min.css.map b/static/const/css/bootstrap-grid.min.css.map similarity index 100% rename from static/css/bootstrap-grid.min.css.map rename to static/const/css/bootstrap-grid.min.css.map diff --git a/static/css/bootstrap-reboot.css b/static/const/css/bootstrap-reboot.css similarity index 100% rename from static/css/bootstrap-reboot.css rename to static/const/css/bootstrap-reboot.css diff --git a/static/css/bootstrap-reboot.css.map b/static/const/css/bootstrap-reboot.css.map similarity index 100% rename from static/css/bootstrap-reboot.css.map rename to static/const/css/bootstrap-reboot.css.map diff --git a/static/css/bootstrap-reboot.min.css b/static/const/css/bootstrap-reboot.min.css similarity index 100% rename from static/css/bootstrap-reboot.min.css rename to static/const/css/bootstrap-reboot.min.css diff --git a/static/css/bootstrap-reboot.min.css.map b/static/const/css/bootstrap-reboot.min.css.map similarity index 100% rename from static/css/bootstrap-reboot.min.css.map rename to static/const/css/bootstrap-reboot.min.css.map diff --git a/static/css/bootstrap.css b/static/const/css/bootstrap.css similarity index 100% rename from static/css/bootstrap.css rename to static/const/css/bootstrap.css diff --git a/static/css/bootstrap.css.map b/static/const/css/bootstrap.css.map similarity index 100% rename from static/css/bootstrap.css.map rename to static/const/css/bootstrap.css.map diff --git a/static/css/bootstrap.min.css b/static/const/css/bootstrap.min.css similarity index 100% rename from static/css/bootstrap.min.css rename to static/const/css/bootstrap.min.css diff --git a/static/css/bootstrap.min.css.map b/static/const/css/bootstrap.min.css.map similarity index 100% rename from static/css/bootstrap.min.css.map rename to static/const/css/bootstrap.min.css.map diff --git a/static/js/bootstrap.bundle.js b/static/const/js/bootstrap.bundle.js similarity index 100% rename from static/js/bootstrap.bundle.js rename to static/const/js/bootstrap.bundle.js diff --git a/static/js/bootstrap.bundle.js.map b/static/const/js/bootstrap.bundle.js.map similarity index 100% rename from static/js/bootstrap.bundle.js.map rename to static/const/js/bootstrap.bundle.js.map diff --git a/static/js/bootstrap.bundle.min.js b/static/const/js/bootstrap.bundle.min.js similarity index 100% rename from static/js/bootstrap.bundle.min.js rename to static/const/js/bootstrap.bundle.min.js diff --git a/static/js/bootstrap.bundle.min.js.map b/static/const/js/bootstrap.bundle.min.js.map similarity index 100% rename from static/js/bootstrap.bundle.min.js.map rename to static/const/js/bootstrap.bundle.min.js.map diff --git a/static/js/bootstrap.js b/static/const/js/bootstrap.js similarity index 100% rename from static/js/bootstrap.js rename to static/const/js/bootstrap.js diff --git a/static/js/bootstrap.js.map b/static/const/js/bootstrap.js.map similarity index 100% rename from static/js/bootstrap.js.map rename to static/const/js/bootstrap.js.map diff --git a/static/js/bootstrap.min.js b/static/const/js/bootstrap.min.js similarity index 100% rename from static/js/bootstrap.min.js rename to static/const/js/bootstrap.min.js diff --git a/static/js/bootstrap.min.js.map b/static/const/js/bootstrap.min.js.map similarity index 100% rename from static/js/bootstrap.min.js.map rename to static/const/js/bootstrap.min.js.map diff --git a/static/js/jquery-3.3.1.slim.min.js b/static/const/js/jquery-3.3.1.slim.min.js similarity index 100% rename from static/js/jquery-3.3.1.slim.min.js rename to static/const/js/jquery-3.3.1.slim.min.js diff --git a/static/js/jquery-3.3.1.slim.min.map b/static/const/js/jquery-3.3.1.slim.min.map similarity index 100% rename from static/js/jquery-3.3.1.slim.min.map rename to static/const/js/jquery-3.3.1.slim.min.map diff --git a/static/js/popper.min.js b/static/const/js/popper.min.js similarity index 100% rename from static/js/popper.min.js rename to static/const/js/popper.min.js diff --git a/templates/layout/bootstrap.html b/templates/layout/bootstrap.html index cfa4515..a079e7d 100644 --- a/templates/layout/bootstrap.html +++ b/templates/layout/bootstrap.html @@ -3,7 +3,7 @@ - + {% if title %} Husstanden - {{ title }} @@ -13,8 +13,8 @@ {% block content %}{% endblock %} - - - + + + \ No newline at end of file