Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Making it easy to add comments #1222
It is relatively easy to add Disqus comments to a Gollum wiki by using their universal embed code.
That works fine for the most basic case, but it messes up the commenting system when pages are renamed in Gollum, as there is no way to track a page by a unique identifier. That is, at the time of writing there is no way to specify a meaningful value for these variables in the Disqus JS embed code snippet:
The way I added Disqus comments was to simply add a mustache partial template (
Using that method, and unless I'm mistaken, limits me to use only the Ruby variables defined in page.rb in the page.mustache and included partial templates.
Would it be possible to expose a unique page ID and the page URL there? Happy to be pointed to an alternative way to access them, too.
There is not really such a thing as a unique identifier of a file in git. Doing
Alternatively, perhaps you could fabricate unique ids yourself, and store them in the page as metadata tags. Use the following syntax:
Note that starting from version
Thanks a lot for the reply. I had actually thought about the metadata too, but I discarded it as it would be a pain to maintain a manual index for each page. I noticed the upcoming change of metadada format, thanks for the tip and for the release notes. Looking forward to 5.0!
I think exposing the SHA1 hash would be quite useful for this purpose. I understand that it's not unique as you are saying, but I think you'd generally not have two pages with the exact same content on a wiki.
Just making a note here so that when v5.0 is released I don't need to look it all up again :)
Essentially, we'll be then able to use these variables in the Disqus embed code: