hugo-theme-hyde-hyde/layouts/_default/single.html

64 lines
2.1 KiB
HTML
Raw Normal View History

2017-09-07 19:41:16 +00:00
{{ define "main" -}}
<div class="post">
<h1>{{ .Title }}</h1>
2018-01-21 14:17:19 +00:00
{{ if ne .Params.showpagemeta false }}
<div class="col-sm-12 col-md-12">
<span class="text-left post-date meta">
2018-01-23 03:02:05 +00:00
{{ if ne .Params.showpdate false }}
<!-- published date -->
{{ if not .Date.IsZero }} {{ .Date.Format .Site.Params.dateformat }} {{end}}
{{ end }}
2018-01-21 14:17:19 +00:00
<!-- 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 }}
2017-09-07 19:41:16 +00:00
{{ .Content }}
</div>
{{- end }}
2014-04-26 22:25:13 +00:00
{{ define "footer" -}}
2018-01-23 03:02:05 +00:00
{{ 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>
2017-09-07 19:41:16 +00:00
{{- end }}