hugo-theme-hyde-hyde/layouts/_default/single.html
2018-01-22 10:03:55 +07:00

57 lines
1.9 KiB
HTML

{{ define "main" -}}
<div class="post">
<h1>{{ .Title }}</h1>
{{ if ne .Params.showpagemeta false }}
<div class="col-sm-12 col-md-12">
<span class="text-left post-date meta">
<!-- published date -->
{{ if not .Date.IsZero }} {{ .Date.Format .Site.Params.dateformat }} {{end}}
<!-- categories -->
{{ if isset .Params "categories" }}
{{ $total := len .Params.categories }}
{{ if gt $total 0 }}
in
{{ $total := sub $total 1 }}
{{ range $i, $cat := sort $.Params.categories }}
<a class="meta" href="{{ "/categories/" | relURL }}{{ $cat | urlize }}">{{ $cat | upper }}</a>{{ if lt $i $total }}, {{ end }}
{{ end }}
{{ end }}
{{ end }}
<!-- tags -->
{{ if isset .Params "tags" }}
{{ $total := len .Params.tags }}
{{ if gt $total 0 }}
{{ $subtotal := sub $total 1 }}
{{ range $i, $tag := sort $.Params.tags }}
<a class="meta" href="{{ "/tags/" | relURL }}{{ $tag | urlize }}">#{{ $tag | upper }}</a>{{ if lt $i $subtotal }} {{ end }}
{{ end }}
{{ end }}
{{ end }}
</span>
</div>
{{ end }}
{{ .Content }}
</div>
{{- end }}
{{ define "footer" -}}
{{ if .Site.Params.highlightjs }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
{{ range .Site.Params.highlightjslanguages }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/{{.}}.min.js"></script>
{{ end }}
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
{{ end }}
<!-- Google Analytics -->
{{ if .Site.GoogleAnalytics }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
<!-- Disqus-->
{{ if .Site.DisqusShortname }}
<h2>Comments</h2>
{{ template "_internal/disqus.html" . }}
{{ end }}
{{- end }}