diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index db2374a4..c73680f0 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -37,25 +37,7 @@
{{- end }}
{{- if (.Param "ShowPostNavLinks") }}
- {{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
- {{- if and (gt (len $pages) 1) (in $pages . ) }}
-
- {{- end }}
+ {{- partial "post_nav_links.html" . }}
{{- end }}
{{- if (and .Site.Params.ShowShareButtons (ne .Params.disableShare true)) }}
{{- partial "share_icons.html" . -}}
diff --git a/layouts/partials/post_nav_links.html b/layouts/partials/post_nav_links.html
new file mode 100644
index 00000000..b988641b
--- /dev/null
+++ b/layouts/partials/post_nav_links.html
@@ -0,0 +1,19 @@
+{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
+{{- if and (gt (len $pages) 1) (in $pages . ) }}
+
+{{- end }}