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 }}
{{ with .Site.Params.since }} <span class="footer-item">
© {{ if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year }} {{ with .Site.Params.since }}
{{ else }} © {{ if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year }}
© {{ now.Year }} {{ else }}
{{ end }} © {{ now.Year }}
{{ if .Site.Params.Author }} {{ .Site.Params.Author }} {{ end }} {{ 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 }}
{{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>. <span class="footer-item">
{{ end }} {{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.
<span id="cs-mode-container" class="cs-mode-container"> </span>
[<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>] {{ end }}
</span> <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 .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,8 +35,16 @@
<footer> <footer>
{{ partial "posts/series.html" . }} {{ if .Site.Params.talkyardServerUrl }}
{{ partial "posts/disqus.html" . }} <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/commento.html" . }}
{{ partial "posts/utteranc.html" . }} {{ partial "posts/utteranc.html" . }}
</footer> </footer>
@ -44,16 +52,4 @@
{{ partial "posts/math.html" . }} {{ partial "posts/math.html" . }}
</section> </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 }} {{ end }}