single.html 3.34 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/ -->

Kaushal Modi's avatar
Kaushal Modi committed
7
{{ partial "draft-tag.html" . }}
8

9
<article class="post h-entry {{ .Section }}">
10
    <header>
11 12
        <div class="center">{{ partial "taxo-buttons.html" . }}</div>

13
        <h1 class="post-title p-name">{{ .Title }}</h1>
14

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

18
        <div class="date-syndication">
19
            {{ partial "date-maybe.html" (dict "page" . "fmt" (.Param "dateform")) }}
20 21
            {{ partial "syndication.html" . }}
        </div>
22

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

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

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

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

45 46
        <div class="e-content">
            {{ partial "headline-hash.html" .Content }}
47
        </div>
48
    </div>
49 50 51
</article>

{{ end }}
Kaushal Modi's avatar
Kaushal Modi committed
52

53 54 55 56 57 58 59 60 61
{{ define "footer" }}

<!-- Print versions at the end of the post, if specified. -->
{{ with .Params.versions }}
    {{ $.Scratch.Set "__versions_len" (len .) }}
    {{ $.Scratch.Set "__versions_cnt" 0 }}
    <hr />
    <div>
        <small>
62
            {{ printf `<span class="small-caps">Versions used</span>:` | safeHTML }}
63
            {{ range $k, $v := . }}
Kaushal Modi's avatar
Kaushal Modi committed
64 65
                {{ printf "<code>%s</code> " $k | safeHTML }}
                {{ if (eq "string" (printf "%T" $v)) }} <!-- Check if the value is a string -->
66 67 68 69 70 71
                    {{ $v_is_hex := findRE "^[0-9a-f]{6,}$" ($v | lower) }}
                    {{ if (and (eq "nim" ($k | lower)) $v_is_hex) }}
                        {{ printf `<a href="https://github.com/nim-lang/Nim/commit/%s">%s</a>` $v $v | safeHTML -}}
                    {{ else }}
                        {{ printf "%s" $v | safeHTML -}} <!-- Don't print strings using "%#v" else they get double-quoted -->
                    {{ end }}
Kaushal Modi's avatar
Kaushal Modi committed
72 73 74 75 76
                {{- else -}}
                    {{- printf "%#v" $v | safeHTML -}} <!-- Cannot print floats like 0.39 using "%s", so using "%#v" -->
                {{- end -}}
                {{- $.Scratch.Add "__versions_cnt" 1 -}}
                {{- cond (eq ($.Scratch.Get "__versions_cnt") ($.Scratch.Get "__versions_len")) "" ", " }}
77 78 79
            {{ end }}
        </small>
    </div>
Kaushal Modi's avatar
Kaushal Modi committed
80 81
{{ end }}

82 83
{{ partial "jump.html" }}

84 85 86 87 88
<!-- Back to top -->
<div class="backtotop center no-text-decoration">
    <a href="#top">back to <span class="top">top</span></a>
</div>

89
<!-- Tags/categories -->
90 91
<div class="right">{{ partial "taxo-buttons.html" . }}</div>
<div class="clear-float"></div>
Kaushal Modi's avatar
Kaushal Modi committed
92

93
<!-- Prev/next post -->
94
{{ partial "prev_next.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
95

96
<a id="bottom"></a>
97
<!-- Send/receive Webmentions -->
Kaushal Modi's avatar
Kaushal Modi committed
98
{{ partial "webmention_send.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
99
{{ partial "webmention_rcv.html" . }}
100 101 102

<!-- Other Comments -->
{{ partial "comments.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
103 104

{{ end }}