blob: 4e75ebc94bf9c382b6f30cd01c2a8ef5489c8538 (
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
<section class="js-comments staticman-comments">
{{ $slug := replace .RelPermalink "/" "" }}
{{ if .Site.Data.comments }}
{{ $comments := index $.Site.Data.comments $slug }}
{{ if $comments }}
{{ if gt (len $comments) 1 }}
<h3>{{ len $comments }} {{ i18n "moreComment" }}</h3>
{{ else }}
<h3>{{ len $comments }} {{ i18n "oneComment" }}</h3>
{{ end }}
{{ else }}
<h3>{{ i18n "noComment" }}</h3>
{{ end }}
{{ $.Scratch.Set "hasComments" 0 }}
{{ range $comments }}
{{ if not .replyThread }}
{{ $.Scratch.Add "hasComments" 1 }}
{{ $.Scratch.Set "threadID" ._id }}
<article id="{{ ._id }}" class="static-comment">
<img class="comment-avatar" src="https://www.gravatar.com/avatar/{{ .email }}?s=48">
<h4>
{{- if .website -}}
<span class="comment-author"><a rel="external nofollow" href="{{ .website }}">{{ .name }}</a></span>
{{- else -}}
<span class="comment-author">{{ .name }}</span>
{{- end -}}
<a href="#{{ ._id }}" title="Permalink to this comment"><time datetime="{{ dateFormat "02 Jan 06 15:04 +01:00" .date }}">{{ dateFormat "02/01/2006 15:04" .date }}</time></a>
</h4>
<div class="comment-content"><p>{{ .comment | markdownify }}</p></div>
<a class="reply-btn" href="#comment-form" title="{{ ._id }}">{{ i18n "replyToMsg" }}</a>
</article>
{{ range $comments }}
{{ if eq .replyThread ($.Scratch.Get "threadID") }}
<article id="{{ ._id }}" class="static-comment static-comment-reply">
<img class="comment-avatar" src="https://www.gravatar.com/avatar/{{ .email }}?s=48">
<h4>
{{- if .website -}}
<span class="comment-author"><a rel="external nofollow" href="{{ .website }}">{{ .name }}</a></span>
{{- else -}}
<span class="comment-author">{{ .name }}</span>
{{- end -}}
<a href="#{{ .replyID }}" class="reply-target">{{ .replyName }}</a>
<a href="#{{ ._id }}" title="Permalink to this comment"><time datetime="{{ dateFormat "02 Jan 06 15:04 +01:00" .date }}">{{ dateFormat "02/01/2006 15:04" .date }}</time></a>
</h4>
<div class="comment-content"><p>{{ .comment | markdownify }}</p></div>
<a class="reply-btn" href="#comment-form" title="{{ .replyThread }}">{{ i18n "replyToMsg" }}</a>
</article>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
<form id="comment-form" class="js-form form" method="post"
action="{{ .Site.Params.staticman.endpoint | default "https://staticman-frama.herokuapp.com" }}/v3/entry/{{ .Site.Params.staticman.gitProvider }}/{{ .Site.Params.staticman.repo }}/{{ .Site.Params.staticman.branch }}/comments">
<!-- Start comment form display reply target -->
<p class="hidden reply-notice">
<strong class="reply-notice-text"></strong>
</p>
<!-- End comment form display reply target -->
<input type="hidden" name="options[slug]" value="{{ replace .RelPermalink "/" "" }}">
<input type="hidden" name="options[parent]" value="">
<input type="hidden" name="fields[replyThread]" value="">
<input type="hidden" name="fields[replyID]" value="">
<input type="hidden" name="fields[replyName]" value="">
{{ if .Site.Params.staticman.recaptcha }}
<input type="hidden" name="options[reCaptcha][siteKey]" value="{{ .Site.Params.staticman.recaptcha.sitekey }}">
<input type="hidden" name="options[reCaptcha][secret]" value="{{ .Site.Params.staticman.recaptcha.secret }}">
{{ end }}
<textarea name="fields[comment]" placeholder="{{ i18n "useMarkdown" }}"></textarea>
<input type="text" name="fields[name]" placeholder="{{ i18n "yourName" }}">
<input type="email" name="fields[email]" placeholder="{{ i18n "yourEmail" }}">
<input type="text" name="fields[website]" placeholder="{{ i18n "yourWebsite" }}">
{{ if .Site.Params.staticman.recaptcha }}
<div class="g-recaptcha" data-sitekey="{{ .Site.Params.staticman.recaptcha.sitekey }}"></div>
{{ end }}
<!-- Start comment form alert messaging -->
<p class="hidden js-notice">
<strong class="js-notice-text"></strong>
</p>
<!-- End comment form alert messaging -->
<input type="submit" value="{{ i18n "btnSubmit" }}" class="button">
<input type="reset" value="{{ i18n "btnReset" }}" class="button">
</form>
</section>
|