mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-08 01:22:29 +00:00
Switch themes to minimo
This commit is contained in:
1
themes/minimo/layouts/partials/comments/disqus.html
Normal file
1
themes/minimo/layouts/partials/comments/disqus.html
Normal file
@@ -0,0 +1 @@
|
||||
{{ template "_internal/disqus.html" . }}
|
6
themes/minimo/layouts/partials/comments/isso.html
Normal file
6
themes/minimo/layouts/partials/comments/isso.html
Normal 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>
|
5
themes/minimo/layouts/partials/comments/staticman.html
Normal file
5
themes/minimo/layouts/partials/comments/staticman.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ partial "comments/staticman/submission-feedback" . }}
|
||||
|
||||
{{ partial "comments/staticman/list" . }}
|
||||
|
||||
{{ partial "comments/staticman/form" . }}
|
@@ -0,0 +1,4 @@
|
||||
{{ $rawStaticmanYML := ( readFile "staticman.yml" ) }}
|
||||
{{ $parsedStaticmanYML := ( transform.Unmarshal $rawStaticmanYML ) }}
|
||||
|
||||
{{ return $parsedStaticmanYML }}
|
@@ -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>
|
75
themes/minimo/layouts/partials/comments/staticman/form.html
Normal file
75
themes/minimo/layouts/partials/comments/staticman/form.html
Normal 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>
|
19
themes/minimo/layouts/partials/comments/staticman/list.html
Normal file
19
themes/minimo/layouts/partials/comments/staticman/list.html
Normal 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 -}}
|
@@ -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>
|
@@ -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>
|
19
themes/minimo/layouts/partials/comments/utterances.html
Normal file
19
themes/minimo/layouts/partials/comments/utterances.html
Normal 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>
|
Reference in New Issue
Block a user