Skip to content

Commit

Permalink
Merge branch 'master' into update-uswds-2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hoaiandang committed Jul 28, 2020
2 parents 7cf6414 + 472991d commit c5a0cb0
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 46 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ node_modules/
.rvmrc

# Jekyll stuff
.jekyll-cache
.jekyll-metadata
.jekyll-cache
_site
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ The default colors can be configured in the `_data/theme.yml` file. Other settin
Before configuring your search you will need to create a search.gov account and set up your website
with search.gov.

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

### Analytics

Expand Down
15 changes: 6 additions & 9 deletions _includes/analytics.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
{% if site.google_analytics_ua %}
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics_ua }}"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics_ua }}', 'auto');
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());

// anonymize user IPs (chops off the last IP triplet)
ga('set', 'anonymizeIp', true);
ga('set', 'forceSSL', true);
ga('send', 'pageview');
// `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
gtag('config', '{{ site.google_analytics_ua }}', { 'anonymize_ip': true, 'forceSSL': true });
</script>
{% endif %}

Expand Down
33 changes: 1 addition & 32 deletions _includes/components/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,38 +95,7 @@
{% if header.type == 'basic' or header.type == 'basic-mega' %}
{% assign _secondary = header.secondary %}
{% if site.search_site_handle %}
<form
accept-charset="UTF-8"
action="https://search.usa.gov/search"
id="search_form"
method="get"
class="usa-search usa-search--small js-search-form">
<input
name="utf8"
type="hidden"
value="&#x2713;" />
<input
id="affiliate"
name="affiliate"
type="hidden"
value="{{ site.search_site_handle }}" />
<div role="search">
<label for="query" class="usa-sr-only">Enter Search Term(s):</label>
<input
autocomplete="off"
class="usa-input usagov-search-autocomplete"
id="query"
name="query"
type="search" />
<button
class="usa-button"
type="submit"
name="commit">
<span class="usa-sr-only">Search</span>
</button>
</div>
</form>
{% endif %}
{% include components/search.html %}
{% endif %}

{% if header.type == 'extended' or header.type == 'extended-mega' %}
Expand Down
11 changes: 11 additions & 0 deletions _includes/components/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<form accept-charset="UTF-8" action="https://search.usa.gov/search" class="usa-search usa-search-small js-search-form" method="get">
<input name="utf8" type="hidden" value="&#x2713;"/>
<input id="affiliate" name="affiliate" type="hidden" value="{{ site.search_site_handle }}"/>
<div role="search">
<label class="usa-sr-only" for="query">Enter Search Term(s):</label>
<input autocomplete="off" class="usagov-search-autocomplete" id="query" name="query" type="search"/>
<button type="submit">
<span class="usa-sr-only">Search</span>
</button>
</div>
</form>
2 changes: 1 addition & 1 deletion _includes/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title>{% if page.title %}{{ page.title }} | {% endif %}{{ site.title }}</title>
<title>{% if page.title %}{{ page.title | strip_html }} | {% endif %}{{ site.title }}</title>

{% assign description = page.description | default: site.description %}
{% if description %}
Expand Down
4 changes: 2 additions & 2 deletions _includes/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
{% endfor %}


{% if site.search %}
{% if site.search_site_handle %}
<script type="text/javascript">
//<![CDATA[
var usasearch_config = { siteHandle:"{{ site.search.site_handle }}" };
var usasearch_config = { siteHandle:"{{ site.search_site_handle }}" };

var script = document.createElement("script");
script.type = "text/javascript";
Expand Down
2 changes: 1 addition & 1 deletion uswds-jekyll.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |s|

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

s.add_runtime_dependency "jekyll", ">= 4.0"
s.add_runtime_dependency "jekyll", ">= 4.0", "< 5"

s.add_development_dependency "bundler"
s.add_development_dependency "rake"
Expand Down

0 comments on commit c5a0cb0

Please sign in to comment.