Open yihui opened 3 years ago
A more practical example is that when some pages are under the same hierarchy, and comment issues for lower level pages have been created, but comment issues for higher level pages do not exist yet, then Utterances will load issues that were created for lower level pages when higher level pages are opened. This was the actual motivation of this PR.
For example, I may have two pages, page A /life/index.html
and page B /life/cooking/index.html
. If people have commented on page B first, page A will use the same Github issue as page B, which is what I'd like to avoid.
If you don't like this change, it will be great if the behavior can be configurable. Thanks!
I think this should be the correct behavior. The current implementation always returns whatever the API brings up, which results in unexpected behavior as per #661 if the API returns incorrect results.
@ericswpark I don't feel optimistic about this PR being accepted or Utterances being actively developed anymore. If exact matching is important to you, I suggest you give Giscus a try. It has a data-strict=1
option, which is very clever and useful in my opinion.
@yihui yup, thanks for the recommendation. I actually switched to Giscus after posting the comment above. It looks like Utterances is abandoned.
Instead of loading the first result in the fuzzy search, how about creating a new issue with the exact title? Then we would be more certain about which issue corresponds to which page. For example, if the page URL (pathname) is
foo/
, but the issue with the titlefoo/
doesn't exist, and two issues with titleshello foo
andbye foo
exist. In this case, Utterances will map comments to the issuehello foo
. I feel it would be better if it creates a new issue with the titlefoo/
instead.Basically it boils down to the decision on whether you want to risk loading a wrong issue for comments, or creating a new but unnecessary issue (e.g.,
hello foo
might be the right issue for the pagefoo/
) when an exact match of the title is not found in existing issues. I feel the former is worse than the latter.