diff --git a/README.md b/README.md index 9da1ad9..a2aef29 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Forked from [Ezhil Theme](https://github.com/vividvilla/ezhil) - Dark/Light Mode toggle - tl:dr; frontamatter - Cache busting for CSS files +- Disqus Comments ## Installation In your Hugo website directory, create a new folder named theme and clone the repo @@ -73,6 +74,8 @@ pygmentsstyle = "monokai" pygmentscodefences = true pygmentscodefencesguesssyntax = true +disqusShortname = "yourDisqusShortname" + paginate=3 # articles per page [params] diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e072801..0e96234 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -28,6 +28,15 @@ {{ end }} {{ end }} + {{- $.Scratch.Set "isDisqus" true -}} + + {{ if not .Site.DisqusShortname }} + {{- $.Scratch.Set "isDisqus" false -}} + {{ end }} + + {{- if eq ($.Scratch.Get "isDisqus") true -}} + {{- partial "disqus.html" . -}} + {{- end -}} {{ end }} diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html new file mode 100644 index 0000000..11bd488 --- /dev/null +++ b/layouts/partials/disqus.html @@ -0,0 +1,19 @@ +
+ + +comments powered by Disqus \ No newline at end of file