summaryrefslogtreecommitdiff
path: root/themes/neonxp/layouts/page.html
blob: c28ab399238b7f642d1e96f61658a7351fc7d75d (plain) (blame)
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
{{ define "main" }}
<article class="h-entry">
  <h1 class="p-name">{{ .Title }}</h1>
  {{if .Date }}
  {{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
  {{ $dateHuman := .Date | time.Format ":date_long" }}
  <time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
  {{end}}
  <div class="e-content">
    {{ .Content }}
  </div>
</article>
<article>
  {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
</article>
{{if .Param "comments"}}
<h2>Комментарии</h2>
{{ range $key, $comment := where .Site.Data.comments "subject" "eq" .Page.Permalink }}
<article>
  <b>{{$comment.from_name}}:</b>
  <p>
    {{if $comment.date }}
    {{ $dateMachine := $comment.date | time.Format "2006-01-02T15:04:05-07:00" }}
    {{ $dateHuman := $comment.date | time.Format ":date_long" }}
    <time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
    {{end}}
  </p>
  <p>{{$comment.body | safeHTML}}</p>
  {{if $comment.body_signature}}
  <details>
    <summary>Подпись</summary>
    <pre>{{$comment.body_signature| safeHTML}}</pre>
  </details>
  {{end}}
</article>
{{ else }}
<article>Комментариев пока нет.</article>
{{ end }}

<article>
  {{ $comment := (print "mailto:blog@neonxp.ru?subject=" .Page.Permalink | safeHTML) }}
  Для отправки комментария достаточно отправить e-mail со своим комментарием
  на адрес
  <a href={{$comment}}>blog@neonxp.ru</a>, в теме нужно указать ссылку на
  пост.<br />
  Или просто нажать кнопку ниже. Всё очень просто :)<br />
  <a class="btn-primary" href={{$comment}}>Написать комментарий</a>
</article>
{{end}}
{{ end }}