aboutsummaryrefslogtreecommitdiff
path: root/layouts/post/single.html
blob: da83b7021f85a008182000044b803571ce0ce57f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{{ define "content" -}}
  {{ $lang := .Site.Data.even.default -}}
  <article class="post">
    <!-- post-header -->
    <header class="post-header">
      <h1 class="post-title">{{ .Title }}</h1>

      <div class="post-meta">
        <span class="post-time"> {{ .Date.Format "2006-01-02" }} </span>
        {{ with .Params.categories -}}
          <div class="post-category">
            {{ range . -}}
              <a href="{{ "categories" | relURL }}/{{ . | urlize }}/">{{ . }}</a>
            {{- end }}
          </div>
        {{- end }}
        {{ if .Site.Params.moreMeta -}}
        <span class="more-meta"> {{ printf $lang.posts.header.wordCount .WordCount }} </span>
        <span class="more-meta"> {{ printf $lang.posts.header.readingTime .ReadingTime }} </span>
        {{- end }}
      </div>
    </header>

    <!-- TOC -->
    {{ partial "post/toc.html" . }}

    <!-- Content -->
    <div class="post-content">
      {{ .Content }}
    </div>

    <!-- Copyright -->
    {{ partial "post/copyright.html" . }}

    <!-- Reward -->
    {{ partial "post/reward.html" . }}

    <footer class="post-footer">
      {{ with .Params.tags -}}
        <div class="post-tags">
          {{ range . }}
          <a href="{{ "tags" | relURL }}/{{ . | urlize }}/">{{ . }}</a>
          {{ end }}
        </div>
      {{- end }}

      <!-- Post Pagination -->
      <nav class="post-nav">
        {{ with .NextInSection }}
          <a class="prev" href="{{ .URL }}">
            <i class="iconfont icon-left"></i>
            <span class="prev-text nav-default">{{ .Title }}</span>
            <span class="prev-text nav-mobile">{{ $lang.posts.prev_post }}</span>
          </a>
        {{- end }}
        {{ with .PrevInSection }}
          <a class="next" href="{{ .URL }}">
            <span class="next-text nav-default">{{ .Title }}</span>
            <span class="prev-text nav-mobile">{{ $lang.posts.next_post }}</span>
            <i class="iconfont icon-right"></i>
          </a>
        {{- end }}
      </nav>
    </footer>
  </article>
{{- end }}