hugo-PaperMod/layouts/_default/single.html
Aditya Telange 274688f238
layouts/single : add option to disable Post-meta
i.e. date, author-info
    can be used for posts which are just info, and not a 'post'

set `hideMeta = true` in Page Variables (https://gohugo.io/variables/page/#page-variables)
2020-08-20 22:28:54 +05:30

49 lines
1.3 KiB
HTML

{{ define "main" }}
<article class="post-single">
<header class="post-header">
<h1 class="post-title">
{{ .Title }}
{{- if .Draft }}<div class="entry-isdraft"><sup>&nbsp;&nbsp;[draft]</sup></div>{{- end }}
</h1>
{{ if .Params.hideMeta }}{{ else }}
<div class="post-meta">
{{- if or .Params.author .Site.Params.author }}
{{- .Params.author | default .Site.Params.author }} · {{ end }}
{{- .Date.Format "January 2, 2006" -}}
</div>
{{end}}
</header>
{{ if .Params.ShowToc }}
<div class="toc">
<details>
<summary>
<div class="details">Table of Contents</div>
</summary>
<blockquote>
{{ .TableOfContents }}
</blockquote>
</details>
</div>
{{ end }}
<div class="post-content">{{ .Content }}</div>
{{- if .Params.tags }}
<footer class="post-footer">
<ul class="post-tags">
{{- range .Params.tags }}
{{- $href := print (absURL "tags/") (urlize .) }}
<li><a href="{{ $href }}">{{ . }}</a></li>
{{- end }}
</ul>
{{ if .Site.Params.ShowShareButtons }}
{{ partial "share-icons.html" . }}
{{ end }}
</footer>
{{- end }}
{{- if $.Site.Params.comments }}
{{- partial "comments.html" . }}
{{- end }}
</article>
{{ end }}{{/* end main */}}