mirror of https://github.com/luizdepra/hugo-coder.git

John Tobin
16.42.2019 26a6a0a7cd6601bc02ab3c55a6ec1dceafa8b969
refs
author John Tobin <johntobin@johntobin.ie>
Tuesday, July 16, 2019 01:42 +0200
committer Luiz F. A. de Prá <luizdepra@users.noreply.github.com>
Tuesday, July 16, 2019 01:42 +0200
commit26a6a0a7cd6601bc02ab3c55a6ec1dceafa8b969
tree 06f12ba0f17dad37e0a8d6f4aa21ae733d94988b tree | zip | gz
parent a1afda5d2217eeb98d4169b6bb5854ee488af763 view | diff
Check if commentoUrl is set before using it. (#198)

* Check if commentoUrl is set before using it.

When a variable does not exist it evaluates to `nil`, and so the
check `(not (eq .Site.Params.commentoUrl ""))` evaluates to true rather
than false because `nil` is not "". Before this change, unless you
explicitly set Params.commentoUrl to "", the commento HTML block would
be added, and this fails because /js/commento.js does not exist. This
change ensures that the commento HTML block is only added whe
Params.commentoUrl exists and is set to a non-empty string.

* Check if DisqusShortname is set before using it.
2 files modified
4 ■■■■ changed files
layouts/partials/posts/commento.html 2 ●●● diff | view | raw | blame | history
layouts/partials/posts/disqus.html 2 ●●● diff | view | raw | blame | history