
page {

	includeJSFooterlibs {

		# Popper & Bootstrap
		popperCDN = https://cdnjs.cloudflare.com/ajax/libs/popper.js/{$bootstrap.cdn.popperjs}/umd/popper.min.js
		popperCDN.integrity = {$bootstrap.cdn.popperjsIntegrity}
		popperCDN.external = 1
		popperCDN.if.isFalse = {$bootstrap.bundle.enable}

		bootstrapCDN = https://cdn.jsdelivr.net/npm/bootstrap@{$bootstrap.cdn.bootstrap}/dist/js/bootstrap.min.js
		bootstrapCDN.integrity = {$bootstrap.cdn.bootstrapJsIntegrity}
		bootstrapCDN.external = 1
		bootstrapCDN.if.isFalse = {$bootstrap.bundle.enable}

		bootstrapCDNBundle = https://cdn.jsdelivr.net/npm/bootstrap@{$bootstrap.cdn.bootstrap}/dist/js/bootstrap.bundle.min.js
		bootstrapCDNBundle.integrity = {$bootstrap.cdn.bootstrapBundleJsIntegrity}
		bootstrapCDNBundle.external = 1
		bootstrapCDNBundle.if.isTrue = {$bootstrap.bundle.enable}
	}

	includeJSFooter {

		# LAZYLOAD
		lazyloadCDN = https://cdn.jsdelivr.net/npm/vanilla-lazyload@{$bootstrap.cdn.lazyload}/dist/lazyload.min.js
		lazyloadCDN.integrity = {$bootstrap.cdn.lazyloadIntegrity}
		lazyloadCDN.external = 1
		lazyloadCDN.if {
			value = 1,2
			isInList = {$bootstrap.extconf.lazyLoad}
		}

	}

	includeCSS {

		# BOOTSTRAP CSS
		bootstrapCDN = https://cdn.jsdelivr.net/npm/bootstrap@{$bootstrap.cdn.bootstrap}/dist/css/bootstrap.min.css
		bootstrapCDN.external = 1
		bootstrapCDN.forceOnTop = 1
		bootstrapCDN.if {
			isFalse = {$bootstrap.cdn.bootswatch}
			#isFalse.data = siteSettings:bootstrap.cdn.bootswatch
		}

		# BOOTSWATCH
		bootswatchCDN = https://cdn.jsdelivr.net/npm/bootswatch@{$bootstrap.cdn.bootstrap}/dist/{$bootstrap.cdn.bootswatch}/bootstrap.min.css
		bootswatchCDN.external = 1
		bootswatchCDN.forceOnTop = 1
		bootswatchCDN.if {
			isTrue = {$bootstrap.cdn.bootswatch}
			#isTrue.data = siteSettings:bootstrap.cdn.bootswatch
		}
	}
}




# jQuery
[traverse(site("configuration"), "settings/bootstrap/disable/jquery") == false && traverse(site("configuration"), "settings/bootstrap/config/jqueryHeader") == true]

	page.includeJSLibs {
		jqueryCDN = https://code.jquery.com/jquery-{$bootstrap.cdn.jquery}.slim.min.js
		jqueryCDN.external = 1
		jqueryCDN.forceOnTop = 1
		jqueryCDN.if.isTrue = {$bootstrap.cdn.enable}
		#jqueryCDN.if.isTrue.data = siteSettings:bootstrap.cdn.enable
	}

[END]

[traverse(site("configuration"), "settings/bootstrap/disable/jquery") == false && traverse(site("configuration"), "settings/bootstrap/config/jqueryHeader") == false]

	page.includeJSFooterlibs {
		jqueryCDN = https://code.jquery.com/jquery-{$bootstrap.cdn.jquery}.slim.min.js
		jqueryCDN.external = 1
		jqueryCDN.forceOnTop = 1
		jqueryCDN.if.isTrue = {$bootstrap.cdn.enable}
		#jqueryCDN.if.isTrue.data = siteSettings:bootstrap.cdn.enable
	}

[END]


