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>
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 18 19
    {{ end }}

    <div class="content">
        {{ .Content }}
    </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
<div class="prev-next-navigator clear-float no-color-links">
32
    {{ partial "prev_next.html" . }}
33
</div>
Kaushal Modi's avatar
Kaushal Modi committed
34

35 36 37
{{/* printf "%#v" $.Site */}}
{{/* printf "%#v" $.Site.Params */}}

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

62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
{{ if .Site.Params.source.ox_hugo }}
    <hr>
    <small>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\"><b>ox-hugo</b>" | safeHTML }}
            {{ else }}
                the <a href="https://github.com/kaushalmodi/ox-hugo"><b>ox-hugo</b></a> package for Emacs/Org-mode
            {{ end }} +
        {{ end }}
        <a href="https://gitlab.com/kaushalmodi/hugo-theme-refined"><code>hugo-theme-refined</code></a> + Hugo <b>{{ .Hugo.Version }}</b>
        {{ with .Hugo.CommitHash }}
            (commit
            {{ . | replaceRE "^[0-9a-f]{7,}" "<a href=\"https://github.com/gohugoio/hugo/commit/${0}\">${0}</a>" | replaceRE ":chroma-([0-9a-f]{7,})" ", using Chroma commit <a href=\"https://github.com/alecthomas/chroma/commit/${1}\">${1}</a>" | safeHTML -}}
            )
        {{- end }}.
        <div>
            <br/>
            <span style="float: right;">

                <i>ox-hugo</i>-generated Markdown
                <a href="{{ $.Site.Params.source.url }}/raw/master/{{ $.Site.Params.source.md_dir }}/{{ .File.Path }}">
                    <b>source</b>
                </a>
                of this page</span>
            <br/>
        </div>
    </small>
    <p>
        {{ with .Site.Params.footer }}
            {{- . | safeHTML -}}
        {{ end }}
    </p>

{{ end }}

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