{{ if .Params.showFullContent }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 1b46c1e..8c8fafa 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -20,17 +20,7 @@
{{ end }}
{{ end }}
-
- {{- $cover := false -}}
- {{- $autoCover := default $.Site.Params.autoCover false }}
- {{- if $autoCover -}}
- {{- $cover = .Resources.GetMatch "cover.*" -}}
- {{- else if .Params.Cover -}}
- {{- if .Resources.GetMatch .Params.Cover }}
- {{ $cover = .Resources.GetMatch .Params.Cover }}
- {{- end -}}
- {{- end -}}
- {{if $cover -}} {{- end }}
+ {{ partial "cover.html" . }}
{{ if .Params.Toc }}
diff --git a/layouts/partials/cover.html b/layouts/partials/cover.html
new file mode 100644
index 0000000..8700c26
--- /dev/null
+++ b/layouts/partials/cover.html
@@ -0,0 +1,15 @@
+{{- $cover := false -}}
+{{- $autoCover := default $.Site.Params.autoCover false }}
+{{- if $autoCover -}}
+ {{- $cover = (.Resources.GetMatch "cover.*").RelPermalink -}}
+{{- else if .Params.Cover -}}
+ {{- if .Resources.GetMatch .Params.Cover }}
+ {{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}}
+ {{- else -}}
+ {{- $cover = absURL .Params.Cover -}}
+ {{- end -}}
+{{- end -}}
+{{if $cover -}}
+
+
+{{- end }}
\ No newline at end of file