Merge pull request #125 from cambid/add-isso

add isso comment to posts
This commit is contained in:
Dmitry Kolosov 2021-12-27 21:40:38 +03:00 committed by GitHub
commit c5f026eed9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/).
- Social icons
- Google Analytics
- Disqus
- ISSO
- Utteranc.es
- RSS feeds
- Hiding posts from the RSS feed
@ -87,6 +88,19 @@ params:
utterancesTheme: "" # optional
utterancesIssue: "" # optional
utterancesLabel: "" # optional
# isso support
isso:
enabled: true # mandatory
data: "https://comments.example.com/" # mandatory
jsLocation: "https://comments.example.com/js/embed.min.js" # mandatory
css: true # optional
lang: "de" # optional
replyToSelf: true # mandatory
requireAuthor: true # mandatory
requireEmail: true # mandatory
id: "thread-id" # optional
avatar: true # optional
avatar-bg: "#f0f0f0" # optional
webmentions:
url: https://yourdomain.com/webemntions/receive
login: hugo-theme-anubis

View File

@ -601,3 +601,9 @@ ul.language-select > li, ul.footer-menu > li {
{{ $custom := resources.Get . }}
{{ $custom.Content }}
{{ end }}
{{ if site.Params.isso.enabled }}
#isso-thread .textarea {
color: #000;
}
{{ end }}

View File

@ -33,4 +33,8 @@
{{ partial "utterances.html" . }}
{{ end }}
{{ if .Site.Params.isso.enabled }}
{{ partial "isso.html" . }}
{{ end }}
{{ end }}

View File

@ -0,0 +1,23 @@
{{ $lang := .Site.Params.isso.lang | default "en" }}
{{ $css := .Site.Params.isso.css | default "true" }}
{{ $id := .Site.Params.isso.id | default "true" }}
{{ $avatar := .Site.Params.isso.avatar | default "true" }}
{{ $avatarbg := .Site.Params.isso.avatarbg | default "#f0f0f0" }}
<article class="post">
<script
data-isso="{{ .Site.Params.isso.data }}"
data-isso-id="{{ $id }}"
data-isso-css="{{ $css }}"
data-isso-lang="{{ $lang }}"
data-isso-reply-to-self="{{ .Site.Params.isso.replyToSelf }}"
data-isso-require-author="{{ .Site.Params.isso.requireAuthor }}"
data-isso-require-email="{{ .Site.Params.isso.requireEmail }}"
data-isso-avatar="{{ $avatar }}"
data-isso-avatar-bg="{{ $avatarbg }}"
src="{{ .Site.Params.isso.jsLocation }}">
</script>
<noscript>Please enable JavaScript to view the comments powered by <a href="https://posativ.org/isso/">Isso</a>.</noscript>
<div>
<section id="isso-thread"></section>
</div>
</article>