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

3
<!-- http://microformats.org/wiki/h-entry -->
Kaushal Modi's avatar
Kaushal Modi committed
4 5 6
<!-- h-entry validation: https://xray.p3k.io/ -->
<!-- authorship testing: https://sturdy-backbone.glitch.me/ -->

7 8
<div class="h-entry">
    <div class="post">
Kaushal Modi's avatar
Kaushal Modi committed
9 10 11 12
        {{ if .Params.draft }}
            <div class="draft right">Draft</div>
            <div class="clear-float"></div>
        {{ end }}
13
        <h1 class="post-title p-name">{{ .Title }}</h1>
14

15 16 17
        <!-- To complete the h-entry meta-data as per https://indiewebify.me/validate-h-entry/ -->
        <a class="u-url hide" href="{{ .Permalink }}"></a>

18 19 20 21
        <div class="date-syndication">
            {{ partial "date-maybe.html" . }}
            {{ partial "syndication.html" . }}
        </div>
22

23 24 25 26 27 28 29
        {{ if not .Params.notoc }}
            {{ with .TableOfContents }}
                <div class="toc">
                    {{ . }}
                    <a href="#top" class="back-to-top">Back to top</a>
                </div>
            {{ end }}
30
            {{ partialCached "toc_on_side.html" . }}
31 32
        {{ end }}

33 34 35 36 37 38
        <div class="content">
            {{ with .Description }}
                <div class="description p-summary">
                    {{ . | markdownify }}
                </div>
            {{ end }}
39

40
            {{ partial "series.html" . }}
41

42
            {{ partial "author.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
43

44 45 46
            <div class="e-content">
                {{ partial "headline-hash.html" .Content }}
            </div>
47

48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
            <!-- 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 }}
        </div>
63
    </div>
Kaushal Modi's avatar
Kaushal Modi committed
64

65 66
    <!-- Tags/categories -->
    {{ partial "post_taxo.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
67 68 69 70 71
</div>
{{ end }}

{{ define "after_main" }}

72
{{ partial "prev_next.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
73

74 75 76
{{/* printf "%#v" $.Site */}}
{{/* printf "%#v" $.Site.Params */}}

Kaushal Modi's avatar
Kaushal Modi committed
77
{{ partial "webmention_send.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
78
{{ partial "webmention_rcv.html" . }}
79
{{ with .Site.Params.remarkbox }}
Kaushal Modi's avatar
Kaushal Modi committed
80
    <div class="comments clear-float">
Kaushal Modi's avatar
Kaushal Modi committed
81
        <hr>
82
        <h2>Comments</h2>
83
        {{ partial "remarkbox.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
84
    </div>
85
{{ else }}
86
    {{ with .Site.Params.isso }}
87
        <div class="comments clear-float">
Kaushal Modi's avatar
Kaushal Modi committed
88
            <hr>
89
            <h2>Comments</h2>
90
            {{ partial "isso.html" . }}
91
        </div>
92 93 94 95 96 97 98 99
        {{/* 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 }}
100
    {{ end }}
101
{{ end }}
Kaushal Modi's avatar
Kaushal Modi committed
102 103

{{ end }}