~nykma/hugo-theme-jane unlisted

ref: ae05152df0ba0df193dadc2e865fd6f2c81aae7b hugo-theme-jane/layouts/posts/single.html -rw-r--r-- 3.5 KiB View raw
ae05152dNyk Ma [+] Clear layouts/index a month ago
                                                                                
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
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
98
99
100
101
102
103
{{ define "content" -}}

  <article class="post bg-white">
    <!-- post-header -->
    <header class="post-header">
      <h1 class="post-title">{{ .Title }}</h1>
      {{ partial "post/i18nlist.html" . }}
      <div class="post-meta">
        <time datetime="{{ .Date.Format "2006-01-02" }}" class="post-time">
          {{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
        </time>
        {{ with .Params.categories -}}
          <div class="post-category">
            {{ range . }}
            {{- $name := . -}}
            {{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
              <a href="{{ .Permalink }}"> {{ $name }} </a>
            {{ end -}}
            {{ end }}
          </div>
        {{- end }}
        {{ if .Site.Params.moreMeta -}}
          <span class="more-meta"> {{ i18n "wordCount" .WordCount }} </span>
          <span class="more-meta"> {{ i18n "readingTime" .ReadingTime }} </span>
        {{- end }}

        <!-- Counter busuanzi -->
        {{ if .Site.Params.counter.busuanzi.enable }}
          <span id="busuanzi_container_page_pv">
            | 阅读 <span id="busuanzi_value_page_pv"></span>
          </span>
        {{ end }}

        <!-- Counter leancloud -->
        {{ if .Site.Params.counter.leancloud.enable }}
          <span id="{{ .RelPermalink }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
            <span class="post-meta-item-text"> | 阅读 </span>
            <span class="leancloud-visitors-count"></span>
          </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 . }}
          {{- $name := . -}}
          {{- with $.Site.GetPage "taxonomy" (printf "tags/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "tags/%s" ($name | urlize))) -}}
          <a href="{{ .Permalink }}">{{ $name }}</a>
          {{ end -}}
          {{ end }}
        </div>
      {{- end }}

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

  <!-- Author Info -->
  {{ if and (.Params.author | default .Site.Author.name) (.Params.showAuthorInfo | default .Site.Params.showAuthorInfo) }}
  {{ partial "author_info.html" (dict "author" (.Params.author | default .Site.Author.name) "context" $) }}
  {{ end }}

  <!-- Comments -->
  {{ partial "comments.html" . }}
{{- end }}