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

3 4 5 6
<!-- http://microformats.org/wiki/h-entry -->
<div class="post h-entry">
    <h1 class="post-title p-name">{{ .Title }}</h1>

Kaushal Modi's avatar
Kaushal Modi committed
7
    {{ partial "date-maybe.html" . }}
8 9 10

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

    <div class="content">
20
        {{ with .Description }}
21
            <div class="description p-summary">
22 23 24 25
                {{ . | markdownify }}
            </div>
        {{ end }}

26 27
        {{ partial "series.html" . }}

28 29 30
        <div class="e-content">
             {{ partial "headline-hash.html" .Content }}
        </div>
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

        <!-- 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 }}
46
    </div>
47
</div>
Kaushal Modi's avatar
Kaushal Modi committed
48

49
<div class="post-catlist right p-category">
50
    {{ partial "post_categories.html" . }}
51
    {{ partial "post_tags.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
52 53 54 55 56 57
</div>

{{ end }}

{{ define "after_main" }}

58
{{ partial "prev_next.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
59

60 61 62
{{/* printf "%#v" $.Site */}}
{{/* printf "%#v" $.Site.Params */}}

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

{{ end }}