{{- $scratch := .Scratch.Get "scratch" -}} {{- if $scratch.Get "production" | and (ne .Site.Params.comment.enable false) | and (ne .Params.comment false) -}} {{- $CDN := $scratch.Get "CDN" -}} {{- /* Disqus Comment System */ -}} {{- if .Site.Params.comment.disqus.enable -}}
{{- $script := printf `` .Site.Params.comment.disqus.shortname -}} {{- slice $script | $scratch.Add "scriptCDN" -}} {{- end -}} {{- /* Gitalk Comment System */ -}} {{- if .Site.Params.comment.gitalk.enable -}} {{- $gitalk := .Site.Params.comment.gitalk -}}
{{- with $CDN.gitalkCSS -}} {{- slice . | $scratch.Add "linkCDN" -}} {{- else -}} {{- slice "lib/gitalk/gitalk.css" | $scratch.Add "linkLocal" -}} {{- end -}} {{- with $CDN.gitalkJS -}} {{- slice . | $scratch.Add "scriptCDN" -}} {{- else -}} {{- slice "lib/gitalk/gitalk.min.js" | $scratch.Add "scriptLocal" -}} {{- end -}} {{- end -}} {{- /* Valine Comment System */ -}} {{- if .Site.Params.comment.valine.enable -}} {{- $valine := .Site.Params.comment.valine -}}
{{- slice "lib/valine/valine.scss" | $scratch.Add "linkLocal" -}} {{- with $CDN.valineJS -}} {{- slice . | $scratch.Add "scriptCDN" -}} {{- else -}} {{- slice "lib/valine/Valine.min.js" | $scratch.Add "scriptLocal" -}} {{- end -}} {{- end -}} {{- /* Facebook Comment System */ -}} {{- if .Site.Params.comment.facebook.enable -}} {{- $facebook := .Site.Params.comment.facebook -}}
{{- $script := `` -}} {{- $script = printf $script $facebook.languageCode $facebook.appId -}} {{- slice $script | $scratch.Add "scriptCDN" -}} {{- end -}} {{- end -}}