Skip to content

Commit c5a0cb0

Browse files
committed
Merge branch 'master' into update-uswds-2.0
2 parents 7cf6414 + 472991d commit c5a0cb0

8 files changed

Lines changed: 24 additions & 46 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ node_modules/
1111
.rvmrc
1212

1313
# Jekyll stuff
14+
.jekyll-cache
1415
.jekyll-metadata
1516
.jekyll-cache
1617
_site

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ The default colors can be configured in the `_data/theme.yml` file. Other settin
271271
Before configuring your search you will need to create a search.gov account and set up your website
272272
with search.gov.
273273

274-
After setting up your site on search.gov you can then add your `site handle` to the `config.yml`.
274+
After setting up your site on search.gov you can then add your `search_site_handle` to the `config.yml`.
275275

276276
### Analytics
277277

_includes/analytics.html

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
{% if site.google_analytics_ua %}
22
<!-- Google Analytics -->
3+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_ua }}"></script>
34
<script>
4-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
5-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
6-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
7-
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
8-
ga('create', '{{ site.google_analytics_ua }}', 'auto');
5+
window.dataLayer = window.dataLayer || [];
6+
function gtag() { dataLayer.push(arguments); }
7+
gtag('js', new Date());
98

10-
// anonymize user IPs (chops off the last IP triplet)
11-
ga('set', 'anonymizeIp', true);
12-
ga('set', 'forceSSL', true);
13-
ga('send', 'pageview');
9+
// `forceSSL` was used for analytics.js (the older Google Analytics script). It isn't documented for gtag.js, but the term occurs in the gtag.js code; figure it doesn't hurt to leave it in. -@afeld, 5/29/19
10+
gtag('config', '{{ site.google_analytics_ua }}', { 'anonymize_ip': true, 'forceSSL': true });
1411
</script>
1512
{% endif %}
1613

_includes/components/header.html

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -95,38 +95,7 @@
9595
{% if header.type == 'basic' or header.type == 'basic-mega' %}
9696
{% assign _secondary = header.secondary %}
9797
{% if site.search_site_handle %}
98-
<form
99-
accept-charset="UTF-8"
100-
action="https://search.usa.gov/search"
101-
id="search_form"
102-
method="get"
103-
class="usa-search usa-search--small js-search-form">
104-
<input
105-
name="utf8"
106-
type="hidden"
107-
value="&#x2713;" />
108-
<input
109-
id="affiliate"
110-
name="affiliate"
111-
type="hidden"
112-
value="{{ site.search_site_handle }}" />
113-
<div role="search">
114-
<label for="query" class="usa-sr-only">Enter Search Term(s):</label>
115-
<input
116-
autocomplete="off"
117-
class="usa-input usagov-search-autocomplete"
118-
id="query"
119-
name="query"
120-
type="search" />
121-
<button
122-
class="usa-button"
123-
type="submit"
124-
name="commit">
125-
<span class="usa-sr-only">Search</span>
126-
</button>
127-
</div>
128-
</form>
129-
{% endif %}
98+
{% include components/search.html %}
13099
{% endif %}
131100

132101
{% if header.type == 'extended' or header.type == 'extended-mega' %}

_includes/components/search.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<form accept-charset="UTF-8" action="https://search.usa.gov/search" class="usa-search usa-search-small js-search-form" method="get">
2+
<input name="utf8" type="hidden" value="&#x2713;"/>
3+
<input id="affiliate" name="affiliate" type="hidden" value="{{ site.search_site_handle }}"/>
4+
<div role="search">
5+
<label class="usa-sr-only" for="query">Enter Search Term(s):</label>
6+
<input autocomplete="off" class="usagov-search-autocomplete" id="query" name="query" type="search"/>
7+
<button type="submit">
8+
<span class="usa-sr-only">Search</span>
9+
</button>
10+
</div>
11+
</form>

_includes/meta.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<meta charset="utf-8">
33
<meta http-equiv="X-UA-Compatible" content="IE=edge">
44

5-
<title>{% if page.title %}{{ page.title }} | {% endif %}{{ site.title }}</title>
5+
<title>{% if page.title %}{{ page.title | strip_html }} | {% endif %}{{ site.title }}</title>
66

77
{% assign description = page.description | default: site.description %}
88
{% if description %}

_includes/scripts.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
{% endfor %}
2727

2828

29-
{% if site.search %}
29+
{% if site.search_site_handle %}
3030
<script type="text/javascript">
3131
//<![CDATA[
32-
var usasearch_config = { siteHandle:"{{ site.search.site_handle }}" };
32+
var usasearch_config = { siteHandle:"{{ site.search_site_handle }}" };
3333

3434
var script = document.createElement("script");
3535
script.type = "text/javascript";

uswds-jekyll.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
1212

1313
s.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|LICENSE|README)}i) }
1414

15-
s.add_runtime_dependency "jekyll", ">= 4.0"
15+
s.add_runtime_dependency "jekyll", ">= 4.0", "< 5"
1616

1717
s.add_development_dependency "bundler"
1818
s.add_development_dependency "rake"

0 commit comments

Comments
 (0)