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:
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique id
The way I added Disqus comments was to simply add a mustache partial template ({{>comments}}) that contains the Disqus embed code, and then modified the stock page.template to reference it. Finally, I copied all stock templates plus the new comments.mustache and modified page.mustache ones to a location of my choice and pointed Gollum to it via the template-dir option (see also issue #1221).
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.
Thanks!
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 (
{{>comments}}) that contains the Disqus embed code, and then modified the stockpage.templateto reference it. Finally, I copied all stock templates plus the newcomments.mustacheand modifiedpage.mustacheones to a location of my choice and pointed Gollum to it via thetemplate-diroption (see also issue #1221).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.
Thanks!