{{ $origin := cond (eq .Site.Params.self_host true) "basic" "cors" }} {{ $data := index .Site.Data.origin $origin }} {{ $is_home := false }} {{ if or (eq .RelPermalink "/") (eq .RelPermalink (relLangURL "/")) }} {{ $is_home = true }} {{ end }} {{- $jsOpts := dict "target" "es2015" "minify" (eq hugo.Environment "production") -}} {{ $urls := slice }} {{ $urls = $urls | append $data.search.js }} {{ if or (eq .Type "post") (eq .Layout "page") $is_home }} {{ with $data.lazyPolyfill.js }} {{ $urls = $urls | append . }} {{ end }} {{ if not $is_home }} {{ with $data.glightbox.js }} {{ $urls = $urls | append . }} {{ end }} {{ with $data.clipboard.js }} {{ $urls = $urls | append . }} {{ end }} {{ end }} {{ end }} {{ if or $is_home (eq .Type "post") (eq .Layout "archives") (eq .Type "categories") (eq .Type "tags") }} {{ $locale := strings.TrimSuffix (path.Ext .Lang) .Lang }} {{ with $data.dayjs.js.common }} {{ $urls = $urls | append . }} {{ end }} {{ with replace $data.dayjs.js.locale ":LOCALE" $locale }} {{ $urls = $urls | append . }} {{ end }} {{ with $data.dayjs.js.relativeTime }} {{ $urls = $urls | append . }} {{ end }} {{ with $data.dayjs.js.localizedFormat }} {{ $urls = $urls | append . }} {{ end }} {{ end }} {{ if or (strings.Contains .Content "