diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index e4a7882..475708c 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -5,18 +5,14 @@
-
+
- {{ if .Params.asciinema }}
- {{ with resources.Get "vendor/asciinema/asciinema-player.css" | minify | fingerprint }}
-
- {{ end }}
- {{ end }}
-{{- if isset .Site.Params "onionlocation" }}
+ {{ partial "asciinema/head" . }}
+{{- if isset .Site.Params "onionlocation" -}}
-{{- end }}
+{{- end -}}
{{ block "title" . }}{{ .Site.Title }}{{ end }}
diff --git a/layouts/_partials/asciinema/csp.html b/layouts/_partials/asciinema/csp.html
new file mode 100644
index 0000000..b64f40c
--- /dev/null
+++ b/layouts/_partials/asciinema/csp.html
@@ -0,0 +1,3 @@
+{{- /* This renders as 'unsafe-eval' . This seems to be work fine
+though. TODO: how to render as proper single quotes? */ -}}
+{{- if .Params.asciinema -}}'unsafe-eval'{{- end -}}
diff --git a/layouts/_partials/asciinema/head.html b/layouts/_partials/asciinema/head.html
new file mode 100644
index 0000000..b112a56
--- /dev/null
+++ b/layouts/_partials/asciinema/head.html
@@ -0,0 +1,8 @@
+{{ if .Params.asciinema }}
+ {{ with resources.Get "vendor/asciinema/asciinema-player.css" | minify | fingerprint }}
+
+ {{ end }}
+ {{ with resources.Get "vendor/asciinema/asciinema-player.min.js" | fingerprint }}
+
+ {{ end }}
+{{ end }}
diff --git a/layouts/_shortcodes/asciinema.html b/layouts/_shortcodes/asciinema.html
index ec6a778..9d096f3 100644
--- a/layouts/_shortcodes/asciinema.html
+++ b/layouts/_shortcodes/asciinema.html
@@ -1,7 +1,4 @@
-{{ with resources.Get "vendor/asciinema/asciinema-player.min.js" | fingerprint }}
-
-{{ end }}