single.html 2.94 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>
5
    <span class="post-date">{{ partial "publishdate-maybe.html" . }}</span>
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
        {{ partial "headline-hash.html" .Content }}
19
    </div>
20
</div>
Kaushal Modi's avatar
Kaushal Modi committed
21

22
<div class="post-catlist right">
23
    {{ partial "post_categories.html" . }}
24
    {{ partial "post_tags.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
25 26 27 28 29 30
</div>

{{ end }}

{{ define "after_main" }}

31
{{ partial "prev_next.html" . }}
Kaushal Modi's avatar
Kaushal Modi committed
32

33 34 35
{{/* printf "%#v" $.Site */}}
{{/* printf "%#v" $.Site.Params */}}

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

60 61
{{ if .Site.Params.source.ox_hugo }}
    <hr>
Kaushal Modi's avatar
Kaushal Modi committed
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
    <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 }}
77
            {{ else }}
Kaushal Modi's avatar
Kaushal Modi committed
78 79 80 81 82 83 84 85 86 87 88 89 90
                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>
91 92
{{ end }}

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