<commit_before><section class="post-comments">
  <h3>Comments</h3>

  {{ $comments := readDir "data/comments" }}
  {{ $.Scratch.Add "hasComments" 0 }}
  {{ $entryId := .UniqueID }}

  {{ range $comments }}
    {{ if eq .Name $entryId }}
      {{ $.Scratch.Add "hasComments" 1 }}
      {{ range $index, $comments := (index $.Site.Data.comments $entryId ) }}
        <div class="post-comment">
          <div class="post-comment-header">
            <img class="post-comment-avatar" src="https://www.gravatar.com/avatar/{{ .email }}?s=100">
            <p class="post-comment-info"><strong>{{ .name }}</strong><br>{{ dateFormat "02/01/2006" .date }}</p>
          </div>
          {{ .body | markdownify }}
        </div>
      {{ end }}       
    {{ end }}
  {{ end }}

  {{ if eq ($.Scratch.Get "hasComments") 0 }}
    <p>Nothing yet.</p>
  {{ end }}

  <h3>Say something</h3>

  <form class="post-new-comment" method="POST" action="https://dev.staticman.net/v2/entry/dancwilliams/networkhobo/master/comments">
    <input type="hidden" name="options[redirect]" value="https://networkhobo.com/comment_confirm">
    <input type="hidden" name="options[entryId]" value="{{ .UniqueID }}">
    <input name="fields[name]" type="text" class="post-comment-field" placeholder="Your name">
    <input name="fields[email]" type="email" class="post-comment-field" placeholder="Your email address">
    <textarea name="fields[body]" class="post-comment-field" placeholder="Your message. Feel free to use Markdown." rows="10"></textarea>
    <input type="hidden" name="options[reCaptcha][siteKey]" value="<KEY>">
<input type="hidden" name="options[reCaptcha][secret]" value="<KEY>>
    
    <input type="submit" class="post-comment-field btn" value="Submit">
  </form>
</section>

<div class="g-recaptcha" data-sitekey="<KEY>"></div>
<script src='https://www.google.com/recaptcha/api.js'></script>

<div id="comment-submitted" class="dialog">
<h3>Thank you</h3>
  <p>Your comment has been submitted and will be published once it has been approved.</p><commit_msg>rework captcha<commit_after><section class="post-comments">
  <h3>Comments</h3>

  {{ $comments := readDir "data/comments" }}
  {{ $.Scratch.Add "hasComments" 0 }}
  {{ $entryId := .UniqueID }}

  {{ range $comments }}
    {{ if eq .Name $entryId }}
      {{ $.Scratch.Add "hasComments" 1 }}
      {{ range $index, $comments := (index $.Site.Data.comments $entryId ) }}
        <div class="post-comment">
          <div class="post-comment-header">
            <img class="post-comment-avatar" src="https://www.gravatar.com/avatar/{{ .email }}?s=100">
            <p class="post-comment-info"><strong>{{ .name }}</strong><br>{{ dateFormat "02/01/2006" .date }}</p>
          </div>
          {{ .body | markdownify }}
        </div>
      {{ end }}       
    {{ end }}
  {{ end }}

  {{ if eq ($.Scratch.Get "hasComments") 0 }}
    <p>Nothing yet.</p>
  {{ end }}

  <h3>Say something</h3>

  <form class="post-new-comment" method="POST" action="https://dev.staticman.net/v2/entry/dancwilliams/networkhobo/master/comments">
    <input type="hidden" name="options[redirect]" value="https://networkhobo.com/comment_confirm">
    <input type="hidden" name="options[entryId]" value="{{ .UniqueID }}">
    <input name="fields[name]" type="text" class="post-comment-field" placeholder="Your name">
    <input name="fields[email]" type="email" class="post-comment-field" placeholder="Your email address">
    <textarea name="fields[body]" class="post-comment-field" placeholder="Your message. Feel free to use Markdown." rows="10"></textarea>
    <input type="hidden" name="options[reCaptcha][siteKey]" value="<KEY>">
    <input type="hidden" name="options[reCaptcha][secret]" value="<KEY>>
    <div class="g-recaptcha" data-sitekey="<KEY>"></div>
    <input type="submit" class="post-comment-field btn" value="Submit">
  </form>
</section>

<script src='https://www.google.com/recaptcha/api.js'></script>

<div id="comment-submitted" class="dialog">
<h3>Thank you</h3>
  <p>Your comment has been submitted and will be published once it has been approved.</p>
{'fraction_non_alphanumeric': 0.20331545587518285, 'fraction_numerical': 0.01121404193076548, 'mean_word_length': 3.8213866039952995, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 85, 'https://': 8, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5009003', 'n_tokens_mistral': 1389, 'n_tokens_neox': 1320, 'n_words': 272}