-
Notifications
You must be signed in to change notification settings - Fork 122
/
scripts.html
53 lines (47 loc) · 1.84 KB
/
scripts.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!-- dynamically determine scripts needed for this config -->
{% assign _scripts = '' | split: '' %}
{% assign _async_marker = 'uswds_async=true' %}
{% assign _site_scripts = site.scripts %}
{% unless _site_scripts -%}
{% assign _uswds_js = '/assets/uswds/js/uswds.min.js' | append: '?' | append: _async_marker %}
{% assign _site_scripts = '' | split: '' | push: _uswds_js %}
{% if site.anchor_js_targets %}
{% assign _anchor_js = '/assets/js/vendor/anchor.min.js' %}
{% assign _anchor_conf_js = '/assets/js/anchor.js' %}
{% assign _site_scripts = _site_scripts
| push: _anchor_js
| push: _main_js %}
{% endif %}
{% endunless %}
{% if site.private_eye %}
{% assign _pi_js = '/assets/js/vendor/private_eye.js' %}
{% assign _pi_conf_js = '/assets/js/private_eye_conf.js' %}
{% assign _site_scripts = _site_scripts
| push: _pi_js
| push: _pi_conf_js %}
{% endif %}
{% assign _scripts = _scripts
| push: _site_scripts
| push: layout.scripts
| push: page.scripts
| uniq %}
{% for _script in _scripts %}
{% assign _src = _script.src | default: _script %}
{% if _src %}
<script src="{{ _src | replace: _async_marker, '' | relative_url }}"{% if _script.async or _src contains _async_marker %} async{% endif %}></script>
{% endif %}
{% endfor %}
{% if site.search_site_handle %}
<script type="text/javascript">
//<![CDATA[
var usasearch_config = { siteHandle:"{{ site.search_site_handle }}" };
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://search.usa.gov/javascripts/remote.loader.js";
document.getElementsByTagName("head")[0].appendChild(script);
//]]>
</script>
{% endif %}
{% if site.touchpoints_form_id %}
<script src="https://touchpoints.app.cloud.gov/touchpoints/{{ site.touchpoints_form_id }}.js" async></script>
{% endif %}