website/themes/terminal-plus-minus/layouts/_default/single.html
2019-09-02 01:51:06 +08:00

78 lines
2.0 KiB
HTML

{{- define "main" -}}
{{- if $.Site.Params.enableBreadcrumbs -}}
{{- partial "optional/breadcrumbs.html" (dict "context" . "class" "site__breadcrumbs" "childClass" "site__breadcrumb") -}}
{{- end -}}
<h1 class="page__title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1>
<div class="page__meta">
{{ if .Params.Date }}
<date class="page__date">
{{ .Date.Format "2006-01-02" }}
</date>
{{ end }}
{{ with .Params.Author }}
<span class="page__author">::
{{ . }}
</span>
{{ end }}
</div>
{{ if .Params.tags }}
<span class="page__tags">
{{ range .Params.tags }}
#<a class="page__tag" rel="tag" href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{- with .Params.Cover -}}
<img src="{{ . | absURL }}" class="page__cover" />
{{- end -}}
{{ if .Params.toc }}
<div class="page__toc">
{{ .TableOfContents }}
</div>
{{ end }}
<article class="page__content" data-is-styled="{{ with $.Site.Params.contentIsStyled }}true{{ end }}">
{{ .Content }}
</article>
{{ if or .NextInSection .PrevInSection }}
<div class="pagination">
<div class="pagination__header">
{{ with $.Site.Params.ReadOtherPosts }}{{ . }}{{ else }}Read more{{ end }}
</div>
<div class="pagination__buttons">
{{ if .NextInSection }}
<a class="pagination__button previous" rel="prev" href="{{ .NextInSection.Permalink }}">
<span class="button icon"></span>
<span class="button text">{{ .NextInSection.Title }}</span>
</a>
{{ else }}
<span></span>
{{ end }}
{{ if .PrevInSection }}
<a class="pagination__button next" rel="next" href="{{ .PrevInSection.Permalink }}">
<span class="button text">{{ .PrevInSection.Title }}</span>
<span class="button icon"></span>
</a>
{{ else }}
<span></span>
{{ end }}
</div>
</div>
{{ end }}
{{- with .File -}}
{{ if ne .Dir "/" }}
{{ partial "optional/comments.html" $ }}
{{- end -}}
{{- end -}}
{{- end -}}