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;
line-height: 2rem;
margin-bottom: 1rem;
a {
color: $link-color;
}
}
.cs-mode-container {
margin: 0 0 0 0.3em;
.footer-item {
margin: 0 0.3em;
}
.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 {
text-transform: capitalize;
font-weight: $heading-font-weight--bold;

View File

@ -4,14 +4,3 @@
{{ define "content" }}
{{ partial "page.html" . }}
{{ 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>
{{ end }}
{{ if not .Site.Params.hideCopyright }}
{{ with .Site.Params.since }}
© {{ if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year }}
{{ else }}
© {{ now.Year }}
{{ end }}
{{ if .Site.Params.Author }} {{ .Site.Params.Author }} {{ end }}
<span class="footer-item">
{{ with .Site.Params.since }}
© {{ if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year }}
{{ else }}
© {{ now.Year }}
{{ end }}
{{ if .Site.Params.Author }} {{ .Site.Params.Author }} {{ end }}
</span>
{{ end }}
{{ if not .Site.Params.hideCredits }}
{{ if not .Site.Params.hideCopyright }} · {{ end }}
{{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.
{{ end }}
<span id="cs-mode-container" class="cs-mode-container">
[<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 class="footer-item">
{{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.
</span>
{{ end }}
<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>]
</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 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>]

View File

@ -35,8 +35,16 @@
<footer>
{{ partial "posts/series.html" . }}
{{ partial "posts/disqus.html" . }}
{{ if .Site.Params.talkyardServerUrl }}
<section class="comment-section">
<h2>Comments</h2>
<script>talkyardServerUrl='{{ .Site.Params.talkyardServerUrl }}';</script>
<script async defer src="{{ .Site.Params.talkyardScriptUrl }}"></script>
<div class="talkyard-comments" data-discussion-id="{{ .Params.discussionId }}" style="margin-top: 45px;">
<noscript>Please enable Javascript to view comments.</noscript>
</div>
</section>
{{ end }}
{{ partial "posts/commento.html" . }}
{{ partial "posts/utteranc.html" . }}
</footer>
@ -44,16 +52,4 @@
{{ partial "posts/math.html" . }}
</section>
{{ if .Site.Params.talkyardServerUrl }}
<section class="comment-section">
<h2>Comments</h2>
<script>talkyardServerUrl='{{ .Site.Params.talkyardServerUrl }}';</script>
<script async defer src="{{ .Site.Params.talkyardScriptUrl }}"></script>
<div class="talkyard-comments" data-discussion-id="{{ .Params.discussionId }}" style="margin-top: 45px;">
<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>
</section>
{{ end }}
{{ end }}