{{- if .Scratch.Get "production" | and .IsPage | and (ne .Site.Params.comment.enable false) | and (ne .Params.comment false) -}} {{- $CDN := .Scratch.Get "CDN" -}} {{- /* Disqus Comment System */ -}} {{- with .Site.Params.comment.disqus.shortname -}}
{{- $script := printf `` . -}} {{- slice $script | $.Scratch.Add "scriptCDN" -}} {{- end -}} {{- /* Gitalk Comment System */ -}} {{- if .Site.Params.comment.gitalk.owner -}} {{- $gitalk := .Site.Params.comment.gitalk -}}
{{- with $CDN.gitalkCSS -}} {{- slice . | $.Scratch.Add "linkCDN" -}} {{- else -}} {{- slice "css/lib/gitalk/gitalk.css" | .Scratch.Add "linkLocal" -}} {{- end -}} {{- with $CDN.gitalkJS -}} {{- slice . | $.Scratch.Add "scriptCDN" -}} {{- else -}} {{- slice "css/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 "css/lib/valine/dark.scss" | .Scratch.Add "linkLocal" -}} {{- with $CDN.valineJS -}} {{- slice . | $.Scratch.Add "scriptCDN" -}} {{- else -}} {{- slice "js/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 -}}