{{ $origin := cond (eq .Site.Params.assets.self_host true) "basic" "cors" }} {{ $data := index .Site.Data.origin $origin }} {{ $is_home := false }} {{ if or (eq .RelPermalink "/") (eq .RelPermalink (relLangURL "/")) (eq .RelPermalink (.Site.Home.RelPermalink)) }} {{ $is_home = true }} {{ end }} {{ $is_categories := and (eq .Kind "taxonomy") (eq .Type "categories") }} {{ $is_category := and (eq .Kind "term") (eq .Type "categories") }} {{ $is_tags := and (eq .Kind "taxonomy") (eq .Type "tags") }} {{ $is_tag := and (eq .Kind "term") (eq .Type "tags") }} {{ $is_post := eq .Type "post"}} {{ $is_page := eq .Layout "page"}} {{ $is_archives := eq .Layout "archives"}} {{- $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 "