{{- $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 */ -}} {{- 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 -}}