Welcome to mirror list, hosted at ThFree Co, Russian Federation.

meta.html « post « partials « layouts - github.com/xianmin/hugo-theme-jane.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6587cbc4bdcc3d625c035ccf5063bab78c9ab474 (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
67
68
69
70
71
72
73
74
<div class="post-meta">
  <div class="post-meta-author">
    by
    {{- $author_id := .Params.author | default .Site.Author.name -}}
    {{- $author := (index ($.Site.Data.authors | default dict) $author_id) -}}
    {{- $author_lang := (index ($author | default dict) .Site.Language.Lang) -}}
    {{- $author_name := $author_lang.name.display | default $author.name.display | default $author_id -}}
    {{- $author_url := $author_lang.url | default $author.url | default .Site.Author.url -}}
    {{ if $author_url }}
      <a href="{{ $author_url | relLangURL | safeURL }}">
        <span class="post-meta-author-name">
          {{ $author_name | safeHTML }}
        </span>
      </a>
    {{ else }}
      {{ $author_name | safeHTML }}
    {{ end }}
  </div>

  <div class="post-meta-time">
    <time datetime="{{ .Date.Format "2006-01-02" }}">
      {{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
    </time>
  </div>

  {{ if ne (.Lastmod.Format ("2006-01-02")) (.Date.Format ("2006-01-02")) }}
    <div class="post-meta-lastmod">
      ({{ i18n "lastMod" }}:
      {{ .Lastmod.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }})
    </div>
  {{ end }}


  <div class="post-meta__right">
    {{ if .Site.Params.moreMeta -}}
      <span class="post-meta-more">
        {{ i18n "wordCount" .WordCount }} -
        {{ i18n "readingTime" .ReadingTime }}
      </span>
    {{- end }}

    {{ with .Params.categories -}}
      <div class="post-meta-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 }}


    <!-- 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>
</div>