add talkyard comments

This commit is contained in:
Ray Elliott 2020-09-13 00:26:35 +01:00
parent 618748f755
commit 25d9bc4199
5 changed files with 53 additions and 41 deletions

View File

@ -316,4 +316,17 @@ div.content .meta-tag {
} }
} }
} }
.footer {
> iframe {
border-radius: 1px;
}
.comment-attr {
margin-top: 25px;
opacity: 0.9;
font-size: 0.9em;
text-align: center;
}
}
} }

View File

@ -4,13 +4,10 @@
font-size: 0.8em; font-size: 0.8em;
line-height: 2rem; line-height: 2rem;
margin-bottom: 1rem; margin-bottom: 1rem;
a {
color: $link-color;
}
} }
.cs-mode-container { .footer-item {
margin: 0 0 0 0.3em; margin: 0 0.3em;
} }
.cs-mode-button { .cs-mode-button {
@ -26,6 +23,16 @@
} }
} }
.footer-link {
font-family: $heading-font-family;
color: $fg-color;
&:hover {
color: $link-color;
text-decoration: underline;
}
}
.cs-mode-state { .cs-mode-state {
text-transform: capitalize; text-transform: capitalize;
font-weight: $heading-font-weight--bold; font-weight: $heading-font-weight--bold;

View File

@ -4,14 +4,3 @@
{{ define "content" }} {{ define "content" }}
{{ partial "page.html" . }} {{ partial "page.html" . }}
{{ end }} {{ end }}
{{ if .Site.Params.talkyardServerUrl }}
<section class="comments">
<script>talkyardServerUrl='{{ .Site.Params.talkyardServerUrl }}';</script>
<script async defer src="{{ .Site.Params.talkyardScriptUrl }}"></script>
<!-- You can specify a per page discussion id on the next line, if your URLs might change. -->
<div class="talkyard-comments" data-discussion-id="{{ .Params.discussionId }}" style="margin-top: 45px;">
<noscript>Please enable Javascript to view comments.</noscript>
</div>
</section>
{{ end }}

View File

@ -4,20 +4,27 @@
<p>{{.}}</p> <p>{{.}}</p>
{{ end }} {{ end }}
{{ if not .Site.Params.hideCopyright }} {{ if not .Site.Params.hideCopyright }}
<span class="footer-item">
{{ with .Site.Params.since }} {{ with .Site.Params.since }}
© {{ if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year }} © {{ if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year }}
{{ else }} {{ else }}
© {{ now.Year }} © {{ now.Year }}
{{ end }} {{ end }}
{{ if .Site.Params.Author }} {{ .Site.Params.Author }} {{ end }} {{ if .Site.Params.Author }} {{ .Site.Params.Author }} {{ end }}
</span>
{{ end }} {{ end }}
{{ if not .Site.Params.hideCredits }} {{ if not .Site.Params.hideCredits }}
{{ if not .Site.Params.hideCopyright }} · {{ end }} {{ if not .Site.Params.hideCopyright }} · {{ end }}
<span class="footer-item">
{{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>. {{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.
</span>
{{ end }} {{ end }}
<span id="cs-mode-container" class="cs-mode-container"> <span id="cs-mode-container" class="footer-item">
[<button type="button" id="cs-mode-button" class="cs-mode-button">Dark Mode: <span id="cs-mode-button-state" class="cs-mode-state">Light</span></button>] [<button type="button" id="cs-mode-button" class="cs-mode-button">Dark Mode: <span id="cs-mode-button-state" class="cs-mode-state">Light</span></button>]
</span> </span>
{{ if .Site.Params.talkyardServerUrl }}
<span class="footer-item comment-attr">Comments by <a class="footer-link" href="https://www.talkyard.io">Talkyard</a>.</span>
{{ end }}
{{ if .Site.Params.commit }} {{ if .Site.Params.commit }}
{{ if or (not .Site.Params.hideCredits) (not .Site.Params.hideCopyright) }} · {{ end }} {{ if or (not .Site.Params.hideCredits) (not .Site.Params.hideCopyright) }} · {{ end }}
[<a href="{{ .Site.Params.commit }}{{ getenv "GIT_COMMIT_SHA" }}">{{ getenv "GIT_COMMIT_SHA_SHORT" }}</a>] [<a href="{{ .Site.Params.commit }}{{ getenv "GIT_COMMIT_SHA" }}">{{ getenv "GIT_COMMIT_SHA_SHORT" }}</a>]

View File

@ -35,15 +35,6 @@
<footer> <footer>
{{ partial "posts/series.html" . }}
{{ partial "posts/disqus.html" . }}
{{ partial "posts/commento.html" . }}
{{ partial "posts/utteranc.html" . }}
</footer>
</article>
{{ partial "posts/math.html" . }}
</section>
{{ if .Site.Params.talkyardServerUrl }} {{ if .Site.Params.talkyardServerUrl }}
<section class="comment-section"> <section class="comment-section">
<h2>Comments</h2> <h2>Comments</h2>
@ -51,9 +42,14 @@
<script async defer src="{{ .Site.Params.talkyardScriptUrl }}"></script> <script async defer src="{{ .Site.Params.talkyardScriptUrl }}"></script>
<div class="talkyard-comments" data-discussion-id="{{ .Params.discussionId }}" style="margin-top: 45px;"> <div class="talkyard-comments" data-discussion-id="{{ .Params.discussionId }}" style="margin-top: 45px;">
<noscript>Please enable Javascript to view comments.</noscript> <noscript>Please enable Javascript to view comments.</noscript>
<p style="margin-top: 25px; opacity: 0.9; font-size: 96%">Comments powered by
<a href="https://www.talkyard.io">Talkyard</a>.</p>
</div> </div>
</section> </section>
{{ end }} {{ end }}
{{ partial "posts/commento.html" . }}
{{ partial "posts/utteranc.html" . }}
</footer>
</article>
{{ partial "posts/math.html" . }}
</section>
{{ end }} {{ end }}