Skip to content

Commit

Permalink
Add Cusdis support (#489)
Browse files Browse the repository at this point in the history
* Add cusdis support

* update example website config.toml
  • Loading branch information
BarthPaleologue committed Jul 10, 2024
1 parent 7108c2e commit acc1dd2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions exampleSite/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pygmentsCodefencesGuessSyntax = true
socialShare = true
delayDisqus = true
showRelatedPosts = true
# cusdisID = "XXX" # Get your App id from cusdis.com
# hideAuthor = true
# gcse = "012345678901234567890:abcdefghijk" # Get your code from google.com/cse. Make sure to go to "Look and Feel" and change Layout to "Full Width" and Theme to "Classic"
# disclaimerText = "The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way."
Expand Down
17 changes: 16 additions & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,22 @@ <h4 class="see-also">{{ i18n "seeAlso" }}</h4>


{{ if (.Params.comments) | or (and (or (not (isset .Params "comments")) (eq .Params.comments nil)) (and .Site.Params.comments (ne .Type "page"))) }}
{{ if .Site.DisqusShortname }}

{{ if .Site.Params.cusdisID }}

<div id="cusdis_thread"
data-host="https://cusdis.com"
data-app-id="{{ .Site.Params.cusdisID }}"
data-page-id="{{ .Permalink }}"
data-page-url="{{ .Permalink }}"
data-page-title="{{ .Title }}"
data-theme="auto"
></div>
<script async defer src="https://cusdis.com/js/cusdis.es.js"></script>

{{ end }}

{{ if .Site.DisqusShortname }}
{{ if .Site.Params.delayDisqus }}
<div class="disqus-comments">
<button id="show-comments" class="btn btn-default" type="button">{{ i18n "show" }} <span class="disqus-comment-count" data-disqus-url="{{ trim .Permalink "/" }}">{{ i18n "comments" }}</span></button>
Expand Down
4 changes: 4 additions & 0 deletions static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ figure:not(.dark) img, img.white {
}
}

#cusdis_thread {
margin-top: 30px;
}

/* --- Navbar --- */

.navbar-custom {
Expand Down

0 comments on commit acc1dd2

Please sign in to comment.