I'm using Disqus comments system and I'm trying to use the feature of adding comment count links.
The code that I can use is below:
<p><a href="https://www.example.com/thisiscanonicalurl1.html#disqus_thread">Comments</a></p>
The above code works but this is where I have some issue. The thing is I have several hundreds of pages so editing the href value with #disqus_thread appended on it for each and every html pages will take a very long time and not feasible. Is there maybe some Javascript code that will dynamically input my canonical url in an <a href> tag with
#disqus_thread appended to the end of the url?
I can't use php code since I'm using html files but I have SSI enabled since I need to use includes for easy template management. Also, all my html pages already have a unique meta tag for rel="canonical".
So what I want to do is something like this:
<p><a href="(some javascript code or other similar codes that will obtain rel=canonical value from the page)#disqus_thread">Comments</a></p>
Is this possible? Or maybe other alternatives?