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