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

single.html « _default « layouts - github.com/nanxiaobei/hugo-paper.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d1b471e17054c0618b7cd94dc75e787d2f1b0f16 (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
{{ define "main" }}

<article class="post-single">
  <header class="post-title">
    <p>
      {{ if .Date }}
      <time>{{ .Date | time.Format ":date_medium" }}</time>
      {{ end }}
      {{ if or .Params.Author site.Author.name }}
      <span>{{ .Params.Author | default site.Author.name }}</span>
      {{ end }}
    </p>
    <h1>{{ .Title }}</h1>
  </header>
  <section class="post-content">{{ .Content }}</section>

  <!-- Post Tags -->
  {{ if .Params.tags }}
  <footer class="post-tags">
    {{ range .Params.tags }} {{ $href := print (absURL "tags/") (urlize .) }}
    <a href="{{ $href }}">{{ . }}</a>
    {{ end }}
  </footer>
  {{ end }}

  <!-- Post Nav -->
  {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}<!---->
  {{ if and (gt (len $pages) 1) (in $pages . ) }}
  <nav class="post-nav">
    {{ with $pages.Next . }}
    <a class="prev" href="{{ .Permalink }}"><span>←</span><span>{{ .Name }}</span></a>
    {{ end }} {{ with $pages.Prev . }}
    <a class="next" href="{{ .Permalink }}"><span>{{ .Name }}</span><span>→</span></a>
    {{ end }}
  </nav>
  {{ end }}

  <!-- Disqus -->
  {{ if and site.DisqusShortname (not (eq .Params.comments false)) }}
  <div id="disqus_thread" class="post-comments"></div>
  <script>
    var disqusShortname = '{{ site.DisqusShortname }}';
    var script = document.createElement('script');
    script.src = 'https://' + disqusShortname + '.disqus.com/embed.js';
    script.setAttribute('data-timestamp', +new Date());
    document.head.appendChild(script);
  </script>
  {{ end }}
</article>

{{ end }}