hugo-soresu

My fork of hugo-xmin

git clone git://git.shimmy1996.com/hugo-soresu.git
commit 2dcb07d85da7f9236edb7bedaedee47f34320f20
parent ed03167026d8f0848b9f0b1d1e4f65e6967df82a
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Tue, 26 Jun 2018 18:13:29 -0500

Load isso.css in <head> and parameterize Isso host.

Diffstat:
Mlayouts/partials/comment.html | 38++++++++++++++++++++------------------
Mlayouts/partials/stylesheet.html | 3+++
2 files changed, 23 insertions(+), 18 deletions(-)
diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html
@@ -1,19 +1,21 @@
+{{ if (and .IsPage .Site.Params.soresuIssoHost) }}
 <hr/>
-<style>{{ partial "css/isso.css" . | safeCSS }}</style>
-<script async
-        data-isso="/isso/"
-        data-isso-css="false"
-        data-isso-lang={{ .Site.Language }}
-        data-isso-reply-to-self="false"
-        data-isso-require-author="true"
-        data-isso-require-email="true"
-        data-isso-max-comments-top="10"
-        data-isso-max-comments-nested="5"
-        data-isso-reveal-on-click="5"
-        data-isso-avatar="true"
-        data-isso-avatar-bg="#ffffff"
-        data-isso-avatar-fg="#700000"
-        data-isso-vote="false"
-        data-vote-levels=""
-        src="/isso/js/embed.min.js"></script>
-<section id="isso-thread"></section>
+<script
+  async
+  data-isso="{{ .Site.Params.soresuIssoHost }}/"
+  data-isso-css="false"
+  data-isso-lang={{ .Site.Language }}
+  data-isso-reply-to-self="false"
+  data-isso-require-author="true"
+  data-isso-require-email="true"
+  data-isso-max-comments-top="10"
+  data-isso-max-comments-nested="5"
+  data-isso-reveal-on-click="5"
+  data-isso-avatar="true"
+  data-isso-avatar-bg="#ffffff"
+  data-isso-avatar-fg="#700000"
+  data-isso-vote="false"
+  data-vote-levels=""
+  src="{{ .Site.Params.soresuIssoHost }}/js/embed.min.js"></script>
+<div id="isso-thread"></div>
+{{ end }}
diff --git a/layouts/partials/stylesheet.html b/layouts/partials/stylesheet.html
@@ -1,2 +1,5 @@
 <style>{{ partial "css/fonts.css" . | safeCSS }}</style>
 <style>{{ partial "css/style.css" . | safeCSS }}</style>
+{{ if (and .IsPage .Site.Params.soresuIssoHost) }}
+<style>{{ partial "css/isso.css" . | safeCSS }}</style>
+{{ end }}