Add post-content only if it exists

This commit is contained in:
Aditya Telange 2021-09-02 13:43:08 +05:30
parent 162d80071f
commit b4393b3d6e
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
2 changed files with 6 additions and 0 deletions

View File

@ -16,11 +16,13 @@
</header>
{{- end }}
{{- if .Content }}
<div class="post-content">
{{- if not (.Param "disableAnchoredHeadings") }}
{{- partial "anchored_headings.html" .Content -}}
{{- else }}{{ .Content }}{{ end }}
</div>
{{- end }}
{{- $pages := union .RegularPages .Sections }}

View File

@ -25,11 +25,15 @@
{{- if (.Param "ShowToc") }}
{{- partial "toc.html" . }}
{{- end }}
{{- if .Content }}
<div class="post-content">
{{- if not (.Param "disableAnchoredHeadings") }}
{{- partial "anchored_headings.html" .Content -}}
{{- else }}{{ .Content }}{{ end }}
</div>
{{- end }}
<footer class="post-footer">
{{- if .Params.tags }}
<ul class="post-tags">