hugo-theme-hyde-hyde/layouts/_default/single.html
2018-01-23 10:02:05 +07:00

63 lines
2.1 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">
{{ if ne .Params.showpdate false }}
<!-- published date -->
{{ if not .Date.IsZero }} {{ .Date.Format .Site.Params.dateformat }} {{end}}
{{ 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 }}
{{ if ne .Params.showcomments false }}
<h2>Comments</h2>
{{ partial "disqus.html" . }}
{{ end }}
{{ end }}
<!-- Other Scripts -->
<script src="{{ .Site.BaseURL }}js/main.js"></script>
{{- end }}