single.html 2.32 KB
Newer Older
Kaushal Modi's avatar
Kaushal Modi committed
1 2 3 4
{{ define "main" }}

<div class="post">
    <h1 class="post-title">{{ .Title }}</h1>
Kaushal Modi's avatar
Kaushal Modi committed
5
    {{ partial "date-maybe.html" . }}
6 7 8

    {{ if not .Params.notoc }}
        {{ with .TableOfContents }}
9
            <div class="toc">
10
                {{ . }}
11
                <a href="#top" class="back-to-top">Back to top</a>
12 13
            </div>
        {{ end }}
14
        {{ partial "toc_on_side.html" . }}
15 16 17
    {{ end }}

    <div class="content">
18 19 20 21 22 23
        {{ with .Description }}
            <div class="description">
                {{ . | markdownify }}
            </div>
        {{ end }}

24 25
        {{ partial "series.html" . }}

26
        {{ partial "headline-hash.html" .Content }}
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

        <!-- Print versions at the end of the post, if specified. -->
        {{ with .Params.versions }}
            {{ $.Scratch.Set "__versions_len" (len .) }}
            {{ $.Scratch.Set "__versions_cnt" 0 }}
            <hr />
            <small>
                {{ printf "<span style=\"font-variant: small-caps;\">Versions used</span>:" | safeHTML }}
                {{ range $k, $v := . }}
                    {{ printf "<code>%s</code> %s" $k $v | safeHTML }}
                    {{ $.Scratch.Add "__versions_cnt" 1 }}
                    {{ cond (eq ($.Scratch.Get "__versions_cnt") ($.Scratch.Get "__versions_len")) "" ", " }}
                {{ end }}
            </small>
        {{ end }}
42
    </div>
43
</div>
Kaushal Modi's avatar
Kaushal Modi committed
44

45
<div class="post-catlist right">
46
    {{ partial "post_categories.html" . }}
47
    {{ partial "post_tags.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
48 49 50 51 52 53
</div>

{{ end }}

{{ define "after_main" }}

54
{{ partial "prev_next.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
55

56 57 58
{{/* printf "%#v" $.Site */}}
{{/* printf "%#v" $.Site.Params */}}

59
{{ with .Site.Params.remarkbox }}
Kaushal Modi's avatar
Kaushal Modi committed
60
    <div class="comments clear-float">
Kaushal Modi's avatar
Kaushal Modi committed
61
        <hr>
62
        <h2>Comments</h2>
63
        {{ partial "remarkbox.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
64
    </div>
65
{{ else }}
66
    {{ with .Site.Params.isso }}
67
        <div class="comments clear-float">
Kaushal Modi's avatar
Kaushal Modi committed
68
            <hr>
69
            <h2>Comments</h2>
70
            {{ partial "isso.html" . }}
71
        </div>
72 73 74 75 76 77 78 79
        {{/* else if not (eq .Site.DisqusShortname "") */}}
        <!-- Below works the same way as the above empty-string equality check -->
    {{ else }}
        {{ with .Site.DisqusShortname }}
            <div class="comments clear-float">
                {{ partial "disqus.html" . }}
            </div>
        {{ end }}
80
    {{ end }}
81
{{ end }}
Kaushal Modi's avatar
Kaushal Modi committed
82 83

{{ end }}