Skip to content

Commit 0fc1e9f

Browse files
committed
Fingerprint js assets
1 parent 42f030e commit 0fc1e9f

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

themes/django20/static/js/events_map.js renamed to assets/js/events_map.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,6 @@ legend.onAdd = function (map) {
125125
});
126126

127127
return div;
128-
};
129-
130-
legend.addTo(map);
128+
};
129+
130+
legend.addTo(map);

themes/django20/layouts/_default/baseof.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@
7171
{{ partial "footer.html" . }}
7272
</footer>
7373

74-
<script src="/js/zoom-vanilla.min.js"></script>
74+
{{ with resources.Get "js/zoom-vanilla.min.js" }}
75+
{{ with . | fingerprint "sha256" }}
76+
<script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
77+
{{ end }}
78+
{{ end }}
7579

7680
</body>
7781

themes/django20/layouts/partials/events_map.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,8 @@
4242
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
4343
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
4444
<!-- project JS file -->
45-
<script src='{{ "js/events_map.js" | relURL }}'></script>
45+
{{ with resources.Get "js/events_map.js" }}
46+
{{ with . | fingerprint "sha256" }}
47+
<script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
48+
{{ end }}
49+
{{ end }}

0 commit comments

Comments
 (0)