dsrkafuu / hugo-theme-fuji

A minimal Hugo theme with nice theme color. | 一个主题色极简 Hugo 主题。
https://github.dsrkafuu.net/hugo-theme-fuji/
Apache License 2.0
368 stars 98 forks source link

utterance repeats comments on each post #95

Closed teotenn closed 1 year ago

teotenn commented 1 year ago

I have been trying to tweak your implementation or utterance but so far unsuccessfully. I would appreciate some support.

Your implementation of utterance with the script is wonderful and I very much like it, but it has an issue, if I get a comment for one post page, it repeats the same comment on every single post.

Do you know how could I change this for the normal behaviour of utterance where comments are unique per post? - I've been trying editing comment-utterances.html but my knowledge of JS is not good enough to achieve the desired result.

Alternatively I tried creating a simple comments.html layout adding there the basic utterance.es code and then adding the following code by the end of components.html :

<div class="bg-white dark:bg-warmgray-900 p-5 my-4">
      <div class="post-comment">
        {{ partial "comments.html" . }}
      </div>
    </div>

But also didn't work. Where would you recommend me to ad the above code to ensure that it shows only in the posts sections?