From: Michael Whatcott Date: Fri, 6 Jun 2014 05:32:06 +0000 (-0600) Subject: Included instructions for omitting disqus comments on localhost. X-Git-Tag: v0.12~84 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=406233f05204966f6799a42e39b0e6cdf4e0da0c;p=brevno-suite%2Fhugo Included instructions for omitting disqus comments on localhost. --- diff --git a/docs/content/extras/comments.md b/docs/content/extras/comments.md index a0f881c5..2b8cce7c 100644 --- a/docs/content/extras/comments.md +++ b/docs/content/extras/comments.md @@ -44,6 +44,38 @@ for a given piece of content * **disqus_title** * **disqus_url** + +## Conditional Loading of Disqus Comments + +Users have noticed that enabling disqus comments when running the hugo web server on localhost causes the creation of unwanted discussions on the associated disqus account. In order to prevent this, a slightly tweaked partial template is required. So, rather than using the built-in `"_internal/disqus.html"` template referenced above, create a template in your `partials` folder that looks like this: + +```javascript +
+ + +comments powered by Disqus +``` + +Notice that there is a simple if statement that detects when you are running on localhost and skips the initialization of the disqus comment injection. + +Now reference the partial template from your page template: + + {{ template "partials/disqus.html" . }} + + # Alternatives A few alternatives exist to Disqus.