single.html 2.28 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
        {{ partial "headline-hash.html" .Content }}
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

        <!-- 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 }}
40
    </div>
41
</div>
Kaushal Modi's avatar
Kaushal Modi committed
42

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

{{ end }}

{{ define "after_main" }}

52
{{ partial "prev_next.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
53

54 55 56
{{/* printf "%#v" $.Site */}}
{{/* printf "%#v" $.Site.Params */}}

57
{{ with .Site.Params.remarkbox }}
Kaushal Modi's avatar
Kaushal Modi committed
58
    <div class="comments clear-float">
Kaushal Modi's avatar
Kaushal Modi committed
59
        <hr>
60
        <h2>Comments</h2>
61
        {{ partial "remarkbox.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
62
    </div>
63
{{ else }}
64
    {{ with .Site.Params.isso }}
65
        <div class="comments clear-float">
Kaushal Modi's avatar
Kaushal Modi committed
66
            <hr>
67
            <h2>Comments</h2>
68
            {{ partial "isso.html" . }}
69
        </div>
70 71 72 73 74 75 76 77
        {{/* 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 }}
78
    {{ end }}
79
{{ end }}
Kaushal Modi's avatar
Kaushal Modi committed
80 81

{{ end }}