Switch themes to minimo

This commit is contained in:
Dave Gallant
2021-09-06 11:55:05 -04:00
parent 75f9797c91
commit 4ff7aec7c1
302 changed files with 17841 additions and 607 deletions

View File

@@ -0,0 +1 @@
{{ template "_internal/disqus.html" . }}

View File

@@ -0,0 +1,6 @@
{{- $scriptSrc := .Page.Site.Params.comments.isso.scriptSrc -}}
{{- $dataAttrs := .Page.Site.Params.comments.isso.dataAttrs -}}
<script src='{{ $scriptSrc }}' {{- with $dataAttrs }} {{ . | safeHTMLAttr }} {{- end -}}></script>
<section id='isso-thread'></section>

View File

@@ -0,0 +1,5 @@
{{ partial "comments/staticman/submission-feedback" . }}
{{ partial "comments/staticman/list" . }}
{{ partial "comments/staticman/form" . }}

View File

@@ -0,0 +1,4 @@
{{ $rawStaticmanYML := ( readFile "staticman.yml" ) }}
{{ $parsedStaticmanYML := ( transform.Unmarshal $rawStaticmanYML ) }}
{{ return $parsedStaticmanYML }}

View File

@@ -0,0 +1,43 @@
{{- $comment := .Comment -}}
{{- $maxDepth := .Page.Site.Params.comments.staticman.maxDepth -}}
<li id='comment-{{ $comment._id }}' class='comment'>
<article class='comment-body'>
<header class='comment-header'>
<div class='comment-author'>
<img alt='{{ i18n "authorsAvatar" ( dict "Author" $comment.author ) }}' src='https://www.gravatar.com/avatar/{{ $comment.email }}?s=64' class='avatar'/>
<b class='fn'>
{{- if $comment.site -}}
<a href='{{ $comment.site }}' rel='external nofollow' class='url'>
{{- $comment.author -}}
</a>
{{- else -}}
{{- $comment.author -}}
{{- end -}}
</b>
<span class='says'>{{ i18n "says" }}: </span>
</div>
<div class='comment-meta'>
<a href='#comment-{{ $comment._id }}'>
{{- $date := ( time ( div ( int $comment.date ) 1000 ) ) -}}
<time datetime='{{ dateFormat "2006-01-02T15:04:05Z07:00" $date }}'>
{{- dateFormat "15:04, Jan 2, 2006" $date -}}
</time>
</a>
</div>
</header>
<div class='comment-content'>
{{ $comment.content | markdownify }}
</div>
<footer class='reply'>
{{- if lt ( .Page.Scratch.Get "comments_depth" ) $maxDepth -}}
<a rel='nofollow' class='button comment-reply-link' href='#respond' onclick='return moveRespondBlock({{ $comment._id }})' aria-label='{{ i18n "replyToAuthor" ( dict "Author" $comment.author ) }}'>
{{ i18n "reply" }}
</a>
{{- end -}}
</footer>
</article>
{{- if lt ( .Page.Scratch.Get "comments_depth" ) $maxDepth -}}
{{ partial "comments/staticman/replies-list" ( dict "ParentId" $comment._id "Page" .Page ) }}
{{- end -}}
</li>

View File

@@ -0,0 +1,75 @@
{{- $staticman := ( partialCached "comments/staticman/GetStaticmanYML" . ) -}}
{{- $config := .Site.Params.comments.staticman -}}
{{- $apiEndpoint := $config.apiEndpoint -}}
{{- $username := $config.github.username | default $config.username -}}
{{- $repo := $config.github.repository | default $config.repository -}}
{{- $_branch := $config.github.branch | default $config.branch -}}
{{- $branch := $_branch | default $staticman.comments.branch -}}
{{- $api := ( print $apiEndpoint "/" $username "/" $repo "/" $branch ) -}}
{{- $reCaptcha := $staticman.comments.reCaptcha | default ( dict "enabled" false ) -}}
<div id='respond' class='comment-respond'>
<h4 class='comment-reply-title'>
{{- i18n "leaveAComment" -}}
<small>
<a rel='nofollow' id='cancel-comment-reply-link' href='#respond' class='button' style='display:none' aria-label='{{ i18n "cancelComment" }}'>
{{- i18n "cancel" -}}
</a>
</small>
</h4>
<form action='{{ $api }}/comments' method='post' id='comment-form' class='comment-form'>
<input type='hidden' name='options[postId]' value='{{ .File.UniqueID }}'>
<input type='hidden' name='options[redirect]' value='{{ .Permalink }}#submission-success'>
<input type='hidden' name='options[redirectError]' value='{{ .Permalink }}#submission-failure'>
<input type='address' name='fields[honeypot]' style='display:none'>
<input type='hidden' name='fields[permalink]' value='{{ .RelPermalink }}'>
<input type='hidden' name='fields[parent_id]' value=''>
{{- if $reCaptcha.enabled -}}
<input type='hidden' name='options[reCaptcha][siteKey]' value='{{ $reCaptcha.siteKey }}'>
<input type='hidden' name='options[reCaptcha][secret]' value='{{ $reCaptcha.secret }}'>
{{- end -}}
<div>
<label for='comment'>{{ i18n "comment" }}*</label>
<textarea id='comment' name='fields[content]' required rows='3'></textarea>
</div>
<div>
<label for='name'>{{ i18n "name" }}*</label>
<input id='name' name='fields[author]' type='text' required>
</div>
<div>
<label for='email'>{{ i18n "email" }}*</label>
<input id='email' name='fields[email]' type='email' required>
</div>
<div>
<label for='url'>{{ i18n "website" }}</label>
<input id='url' name='fields[site]' type='url'>
</div>
{{- if $reCaptcha.enabled -}}
<div class='g-recaptcha' data-sitekey='{{ $reCaptcha.siteKey }}' data-callback="enableSubmitComment"></div>
<script type="text/javascript">
function enableSubmitComment(){
document.getElementById("submitComment").disabled = false;
}
</script>
<script async src='https://www.google.com/recaptcha/api.js'></script>
{{- end -}}
<div>
<button type='submit' id="submitComment" {{- with $reCaptcha.enabled }} disabled {{- end }}>
{{- i18n "submitComment" -}}
</button>
</div>
</form>
</div>

View File

@@ -0,0 +1,19 @@
{{- $entryId := .File.UniqueID -}}
{{- if isset .Site.Data.comments $entryId -}}
{{- $comments := ( index .Site.Data.comments $entryId ) -}}
<h3 class='comments-title'>
{{ i18n "commentsOnEntry" ( dict "Count" ( len $comments ) "Title" .Title ) }}
</h3>
<ol class='comment-list'>
{{- range $index, $comment := $comments -}}
{{- $.Scratch.Set "comments_depth" 1 -}}
{{- if not $comment.parent_id -}}
{{ partial "comments/staticman/comment" ( dict "Comment" $comment "Page" $ ) }}
{{- end -}}
{{- end -}}
</ol>
{{- end -}}

View File

@@ -0,0 +1,11 @@
{{- .Page.Scratch.Add "comments_depth" 1 -}}
{{- $comments := ( index .Page.Site.Data.comments .Page.File.UniqueID ) -}}
{{- $parentId := .ParentId -}}
<ol class='children'>
{{- range $index, $comment := $comments -}}
{{- if ( eq $comment.parent_id $parentId ) -}}
{{ partial "comments/staticman/comment" ( dict "Comment" $comment "Page" $.Page ) }}
{{- end -}}
{{- end -}}
</ol>

View File

@@ -0,0 +1,11 @@
<div id='submission-success' class='comment-submission-feedback'>
<h4>{{ i18n "commentSubmissionSuccessTitle" }}</h4>
<span>{{ i18n "commentSubmissionSuccessMessage" }}</span>
<a href='#comments' class='button'>{{ i18n "ok" }}</a>
</div>
<div id='submission-failure' class='comment-submission-feedback'>
<h4>{{ i18n "commentSubmissionErrorTitle" }}</h4>
<span>{{ i18n "commentSubmissionErrorMessage" }}</span>
<a href='#comments' class='button'>{{ i18n "ok" }}</a>
</div>

View File

@@ -0,0 +1,19 @@
{{- $scriptSrc := "https://utteranc.es/client.js" -}}
{{- $issueTerm := .Page.Site.Params.comments.utterances.issueTerm -}}
{{- $label := .Page.Site.Params.comments.utterances.label -}}
{{- $theme := .Page.Site.Params.comments.utterances.theme -}}
{{- $username := .Page.Site.Params.comments.utterances.github.username -}}
{{- $repository := .Page.Site.Params.comments.utterances.github.repository -}}
<script src='{{ $scriptSrc }}'
repo='{{ print $username "/" $repository }}'
issue-term='{{ $issueTerm }}'
{{ if $label -}}
label='{{ $label }}'
{{- end }}
{{ if $theme -}}
theme='{{ $theme }}'
{{- end }}
crossorigin='anonymous' async>
</script>