feature(share): support 28 kinds of share links

This commit is contained in:
Dillon
2020-02-18 02:53:07 +08:00
parent ad4655ce6a
commit 434f8fa676
18 changed files with 397 additions and 202 deletions

View File

@@ -10,13 +10,6 @@
{{- slice "css/lib/iconfont/iconfont.css" | .Scratch.Add "linkLocal" -}}
{{- end -}}
{{- /* lazysizes https://github.com/aFarkas/lazysizes */ -}}
{{- with $CDN.lazysizesJS -}}
{{- slice . | $.Scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/lazysizes/lazysizes.min.js" | .Scratch.Add "scriptLocal" -}}
{{- end -}}
{{- /* Smooth Scroll https://github.com/cferdinandi/smooth-scroll */ -}}
{{- with $CDN.smoothScrollJS -}}
{{- slice . | $.Scratch.Add "scriptCDN" -}}
@@ -24,6 +17,22 @@
{{- slice "js/lib/smooth-scroll/smooth-scroll.polyfills.min.js" | .Scratch.Add "scriptLocal" -}}
{{- end -}}
{{- /* Sharer.js https://github.com/ellisonleao/sharer.js */ -}}
{{- if .Scratch.Get "share" -}}
{{- with $CDN.sharerJS -}}
{{- slice . | $.Scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/sharer/sharer.min.js" | .Scratch.Add "scriptLocal" -}}
{{- end -}}
{{- end -}}
{{- /* lazysizes https://github.com/aFarkas/lazysizes */ -}}
{{- with $CDN.lazysizesJS -}}
{{- slice . | $.Scratch.Add "scriptCDN" -}}
{{- else -}}
{{- slice "js/lib/lazysizes/lazysizes.min.js" | .Scratch.Add "scriptLocal" -}}
{{- end -}}
{{- /* TypeIt https://github.com/alexmacarthur/typeit */ -}}
{{- with .Scratch.Get "typeitMap" -}}
{{- with $CDN.typeitJS -}}