single.html 3.04 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
    </div>
26
</div>
Kaushal Modi's avatar
Kaushal Modi committed
27

28
<div class="post-catlist right">
29
    {{ partial "post_categories.html" . }}
30
    {{ partial "post_tags.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
31 32 33 34 35 36
</div>

{{ end }}

{{ define "after_main" }}

37
{{ partial "prev_next.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
38

39 40 41
{{/* printf "%#v" $.Site */}}
{{/* printf "%#v" $.Site.Params */}}

42
{{ with .Site.Params.remarkbox }}
Kaushal Modi's avatar
Kaushal Modi committed
43
    <div class="comments clear-float">
Kaushal Modi's avatar
Kaushal Modi committed
44
        <hr>
45
        <h2>Comments</h2>
46
        {{ partial "remarkbox.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
47
    </div>
48
{{ else }}
49
    {{ with .Site.Params.isso }}
50
        <div class="comments clear-float">
Kaushal Modi's avatar
Kaushal Modi committed
51
            <hr>
52
            <h2>Comments</h2>
53
            {{ partial "isso.html" . }}
54
        </div>
55 56 57 58 59 60 61 62
        {{/* 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 }}
63
    {{ end }}
64
{{ end }}
Kaushal Modi's avatar
Kaushal Modi committed
65

66 67
{{ if .Site.Params.source.ox_hugo }}
    <hr>
Kaushal Modi's avatar
Kaushal Modi committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
    <div class="footer">
        <p>
            This site is generated using
            {{ with .Site.Params.source.org_dir }}
                {{ with $.Params.creator }}
                    {{ . | replaceRE "ox-hugo" "<a href=\"https://github.com/kaushalmodi/ox-hugo\"><code>ox-hugo</code></a>" | safeHTML }}
                {{ else }}
                    the <a href="https://github.com/kaushalmodi/ox-hugo"><code>ox-hugo</code></a> package for Emacs/Org-mode
                {{ end }} +
            {{ end }}
            <a href="https://gitlab.com/kaushalmodi/hugo-theme-refined"><code>hugo-theme-refined</code></a> +
            {{ $hugo_version := .Hugo.Version }}
            {{ with .Hugo.CommitHash }}
                Hugo&nbsp;{{ . | replaceRE "^[0-9a-f]{7,}" "<a href=\"https://github.com/gohugoio/hugo/commit/${0}\">" | replaceRE ":chroma-([0-9a-f]{7,})" "" | safeHTML -}}{{ $hugo_version }}
                {{ printf "</a>" | safeHTML }}
83
            {{ else }}
Kaushal Modi's avatar
Kaushal Modi committed
84 85 86 87 88 89 90 91 92 93 94 95 96
                Hugo&nbsp;{{ $hugo_version }}
            {{ end }}
            <br />
            &mdash;&nbsp;<code>ox-hugo</code>-generated Markdown
            <a href="{{ $.Site.Params.source.url }}/raw/master/{{ $.Site.Params.source.md_dir }}/{{ .File.Path }}">source</a>
            of this page.
        </p>
        <p>
            {{ with .Site.Params.footer }}
                {{- . | safeHTML -}}
            {{ end }}
        </p>
    </div>
97 98
{{ end }}

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