uswds-jekyll 5.2.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84151ee36e5dee15c291972675e4d0729dbcf813886683f27efa8548b2cb550d
4
- data.tar.gz: 68991524fdfd3a08ca5642dd9d41bf1c7308eade2477802f0d8dceb7a83d8eeb
3
+ metadata.gz: 29e08c0c93242d0988e5b023c39b250ecb253f039ad18db213a11a0c19232c27
4
+ data.tar.gz: 31e0ba8838991c621837ddd6790a972174f4b56ed3b7920ef3ec68f9f93fe53c
5
5
  SHA512:
6
- metadata.gz: 8eccde348a2be434e4f280293b1e181069f1487766317cce3dbd4a5fe5caaed4d0424f13225659b32f6c2535aae2150afe9a5860179d57b6529aa68457880084
7
- data.tar.gz: 9c451c5628afca130330ea6336c945c780959bcab350fd8c5cf133ab27eaf142098691fa6dc6bb3578059c39f1511036b541f371898c4c42336737ac3a01b5f4
6
+ metadata.gz: 3bc6518ab545cce8c5dcca05413cf759a66f0114cea6d5e3df31519b2a8092366c8d3ea5518a0571cd78b489e47dad9e08ac9f01dd094eec05d0930aa379e8d1
7
+ data.tar.gz: 70820de8069997a91357ba38291226ac4d4093817aaf5cd27f72c5e0824db79ea3c3d3be86bba6e914abbb0ec542f79b9e96e78e4ca6edd1534ebfcb64e0d464
data/README.md CHANGED
@@ -20,6 +20,7 @@ This is a [Jekyll theme](https://jekyllrb.com/docs/themes/) for the
20
20
  - [Analytics](#analytics)
21
21
  - [Last modified date](#last-modified-date)
22
22
  - [Anchor JS](#anchor-js)
23
+ - [Private Eye JS](#private-eye-js)
23
24
  1. [Assets](#assets)
24
25
  - [Stylesheets](#stylesheets)
25
26
  - [Scripts](#scripts)
@@ -311,6 +312,14 @@ You can show an anchor link next to header tags by uncommenting this section fro
311
312
  # anchor_js_targets: [h1, h2, h3, h4, h5, h6]
312
313
  ```
313
314
 
315
+ ### Private Eye JS
316
+
317
+ By default, the USWDS Jekyll theme uses [Private Eye](https://github.com/18F/private-eye) to denote private links. You can turn this off with the setting below. If you would like to customize the default Private Eye configuration, you can find it in `/assets/js/private_eye_conf.js`.
318
+
319
+ ```yml
320
+ private_eye: false
321
+ ```
322
+
314
323
  ## Assets
315
324
 
316
325
  The [stylesheet](_includes/styles.html) and [script](_includes/scripts.html) includes each incorporate the USWDS CSS and JS files if the corresponding `styles` and `scripts` lists aren't defined in your `_config.yml`. So unless you add one or both of those manually, your HTML will include the following:
@@ -536,9 +545,6 @@ See [this example pull request](https://github.com/18F/before-you-ship/pull/458)
536
545
  --> footer.yml
537
546
  type: [slim | default | big]
538
547
 
539
- --> navigation.yml
540
- sidenav-breakpoint: {{ breakpoint_token }}
541
-
542
548
  --> theme.yml (examples)
543
549
  colors:
544
550
  usa-banner:
@@ -1,18 +1,25 @@
1
+ <!-- dynamically determine scripts needed for this config -->
1
2
  {% assign _scripts = '' | split: '' %}
2
3
  {% assign _async_marker = 'uswds_async=true' %}
3
4
  {% assign _site_scripts = site.scripts %}
4
5
  {% unless _site_scripts -%}
5
6
  {% assign _uswds_js = '/assets/uswds/js/uswds.min.js' | append: '?' | append: _async_marker %}
6
- {% assign _site_scripts = '' | split: ''
7
- | push: _uswds_js %}
8
- {% if site.anchor_js_targets %}
9
- {% assign _anchor_js = '/assets/js/vendor/anchor.min.js' %}
10
- {% assign _main_js = '/assets/js/main.js' %}
11
- {% assign _site_scripts = _site_scripts
12
- | push: _anchor_js
13
- | push: _main_js %}
14
- {% endif %}
7
+ {% assign _site_scripts = '' | split: '' | push: _uswds_js %}
8
+ {% if site.anchor_js_targets %}
9
+ {% assign _anchor_js = '/assets/js/vendor/anchor.min.js' %}
10
+ {% assign _anchor_conf_js = '/assets/js/anchor.js' %}
11
+ {% assign _site_scripts = _site_scripts
12
+ | push: _anchor_js
13
+ | push: _main_js %}
14
+ {% endif %}
15
15
  {% endunless %}
16
+ {% if site.private_eye %}
17
+ {% assign _pi_js = '/assets/js/vendor/private_eye.js' %}
18
+ {% assign _pi_conf_js = '/assets/js/private_eye_conf.js' %}
19
+ {% assign _site_scripts = _site_scripts
20
+ | push: _pi_js
21
+ | push: _pi_conf_js %}
22
+ {% endif %}
16
23
  {% assign _scripts = _scripts
17
24
  | push: _site_scripts
18
25
  | push: layout.scripts
@@ -33,16 +33,14 @@
33
33
  }
34
34
  }
35
35
 
36
- @if variable-exists(theme-sidenav-breakpoint) {
37
- @include at-media($theme-sidenav-breakpoint){
38
- .usa-layout-docs__sidenav {
39
- @include u-flex(3);
40
- order: 1;
41
- padding-top: 0;
42
- }
43
- .usa-layout-docs__main {
44
- @include u-flex(9);
45
- order: 2;
46
- }
36
+ @include at-media($theme-sidenav-breakpoint){
37
+ .usa-layout-docs__sidenav {
38
+ @include u-flex(3);
39
+ order: 1;
40
+ padding-top: 0;
47
41
  }
48
- }
42
+ .usa-layout-docs__main {
43
+ @include u-flex(9);
44
+ order: 2;
45
+ }
46
+ }
@@ -63,7 +63,7 @@ future version of Sass' warning.
63
63
  $value-is-map: if(type-of($val-props) == "map", true, false);
64
64
 
65
65
  @if $media-key {
66
- $media-prefix: #{$media-key}\: ;
66
+ $media-prefix: #{$media-key}\:;
67
67
  }
68
68
 
69
69
  .#{$media-prefix}#{ns("utility")}#{$selector} {
@@ -268,7 +268,7 @@ through all possible variants
268
268
  // all our build in the same loop.
269
269
 
270
270
  $our-modifiers: (
271
- "slug": null
271
+ "slug": null,
272
272
  );
273
273
  }
274
274
 
@@ -7,7 +7,7 @@
7
7
  ========================================
8
8
  ========================================
9
9
  ----------------------------------------
10
- USWDS 2.7.0
10
+ USWDS 2.9.0
11
11
  ----------------------------------------
12
12
  SPACING SETTINGS
13
13
  ----------------------------------------
@@ -7,7 +7,7 @@
7
7
  ========================================
8
8
  ========================================
9
9
  ----------------------------------------
10
- USWDS 2.4.0
10
+ USWDS 2.9.0
11
11
  ----------------------------------------
12
12
  SPACING SETTINGS
13
13
  ----------------------------------------
@@ -13,7 +13,7 @@ $if-important: "";
13
13
 
14
14
  @each $face, $stack in $project-font-stacks {
15
15
  @if $stack {
16
- [class*="#{ns("utility")}font-#{$face}-"] {
16
+ [class*="#{ns('utility')}font-#{$face}-"] {
17
17
  font-family: #{$stack}#{$if-important};
18
18
  }
19
19
  }
@@ -32,9 +32,7 @@
32
32
  @import 'uswds/components/site-width';
33
33
  {% endif %}
34
34
 
35
- {% if site.data.navigation.sidenav-breakpoint %}
36
- $theme-sidenav-breakpoint: '{{ site.data.navigation.sidenav-breakpoint }}';
37
- {% endif %}
35
+ $theme-sidenav-breakpoint: '{{ site.data.navigation.sidenav-breakpoint | default: "desktop" }}';
38
36
 
39
37
  // Banner colors
40
38
  {% assign colors_banner = site.data.theme.colors.usa-banner %}
File without changes
@@ -0,0 +1,39 @@
1
+
2
+ document.addEventListener('DOMContentLoaded', function() {
3
+ PrivateEye({
4
+ defaultMessage: "This link is private to TTS.",
5
+ ignoreUrls: [
6
+ '18f.slack.com',
7
+ 'anywhere.gsa.gov',
8
+ 'bookit.gsa.gov',
9
+ 'calendar.gsa.gov',
10
+ 'connect.gsa.gov',
11
+ 'docs.google.com',
12
+ 'drive.google.com',
13
+ 'ea.gsa.gov',
14
+ 'email.gsa.gov',
15
+ 'eopf.opm.gov',
16
+ 'gcims.gsa.gov',
17
+ 'github.com/18F/Accessibility_Reviews',
18
+ 'github.com/18F/blog-drafts',
19
+ 'github.com/18F/codereviews',
20
+ 'github.com/18F/DevOps',
21
+ 'github.com/18F/Infrastructure',
22
+ 'github.com/18F/security-incidents',
23
+ 'github.com/18F/staffing',
24
+ 'github.com/18F/team-api.18f.gov',
25
+ 'github.com/18F/writing-lab',
26
+ 'gkey.gsa.gov',
27
+ 'gsa-tts.slack.com',
28
+ 'gsa.my.salesforce.com',
29
+ 'gsaolu.gsa.gov',
30
+ 'hrlinks.gsa.gov',
31
+ 'hrprod.hr.gsa.gov',
32
+ 'insite.gsa.gov',
33
+ 'mail.gsa.gov',
34
+ 'meet.gsa.gov',
35
+ 'sign.gsa.gov',
36
+ 'tock.18f.gov'
37
+ ]
38
+ });
39
+ }, false );
@@ -0,0 +1,106 @@
1
+ // https://github.com/18F/private-eye
2
+ (function() {
3
+ 'use strict';
4
+
5
+ // The line below differs from private eye v2.0. We need to update the source file.
6
+ var STYLES = 'a.private-link::after { content: "\\1F512"; font-size: 0.75em; text-decoration: none }';
7
+ var STYLES_ID = '_privateEye-styles';
8
+
9
+ var DEFAULT_OPTIONS = {
10
+ defaultMessage: 'This is a link to a private site, which may or may not be accessible to you.',
11
+ wrapper: ''
12
+ };
13
+
14
+ var isString = function(str) { return !!str && typeof str === 'string'; };
15
+ var isArray = function(arr) { return !!arr && arr.length; };
16
+
17
+ var optionValidators = {
18
+ defaultMessage: isString,
19
+ wrapper: isString,
20
+ ignoreUrls: isArray,
21
+ };
22
+
23
+ function setStyles() {
24
+ var styles = document.createElement('style');
25
+ styles.innerHTML = STYLES;
26
+ styles.id = STYLES_ID;
27
+ document.body.appendChild(styles);
28
+ }
29
+
30
+ function getOptions(opts) {
31
+ var newObj = {};
32
+
33
+ for (var prop in DEFAULT_OPTIONS) {
34
+ newObj[prop] = DEFAULT_OPTIONS[prop];
35
+ }
36
+
37
+ for (var prop in opts) {
38
+ var val = opts[prop];
39
+
40
+ if (optionValidators[prop](val)) {
41
+ newObj[prop] = val;
42
+ }
43
+ }
44
+
45
+ return newObj;
46
+ }
47
+
48
+ var PrivateEye = function(opts) {
49
+ // The old docs recommend calling this as a function. This is here to detect
50
+ // those cases and make sure backward compatibility stays intact now that the
51
+ // new syntax is preferred.
52
+ if (!(this instanceof PrivateEye)) {
53
+ return new PrivateEye(opts);
54
+ }
55
+
56
+ // Don't add the styles to the page more than once.
57
+ if (!document.getElementById(STYLES_ID)) {
58
+ setStyles();
59
+ }
60
+
61
+ this.opts = getOptions(opts);
62
+
63
+ this.checkLinks();
64
+ };
65
+
66
+ PrivateEye.prototype.checkLinks = function() {
67
+ var self = this;
68
+
69
+ this.opts.ignoreUrls.forEach(function(url) {
70
+ var hrefValue;
71
+ var titleValue;
72
+
73
+ // If the `url` is an Object, then parse the properties `message` & `url`
74
+ if (url === Object(url)) {
75
+ titleValue = url.message;
76
+ hrefValue = url.url;
77
+ } else {
78
+ hrefValue = url;
79
+ titleValue = self.opts.defaultMessage;
80
+ }
81
+
82
+ var wrapper = self.opts.wrapper.length ? self.opts.wrapper + ' ' : '';
83
+ var selector = wrapper + 'a';
84
+ var anchors = document.querySelectorAll(selector);
85
+
86
+ Array.prototype.forEach.call(anchors, function(anchor) {
87
+ var anchorHref = anchor.href.toLowerCase().trim();
88
+
89
+ if (anchorHref.indexOf(hrefValue.toLowerCase()) !== -1) {
90
+ anchor.className += ' private-link';
91
+
92
+ // Only replace the anchor's title if it is empty
93
+ if (!anchor.title) {
94
+ anchor.title = titleValue;
95
+ }
96
+ }
97
+ });
98
+ });
99
+ }
100
+
101
+ if (typeof module === 'object' && typeof module.exports === 'object') {
102
+ module.exports = PrivateEye;
103
+ } else {
104
+ window.PrivateEye = PrivateEye;
105
+ }
106
+ })();
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uswds-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shawn Allen
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2020-10-01 00:00:00.000000000 Z
15
+ date: 2021-01-29 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: jekyll
@@ -48,6 +48,20 @@ dependencies:
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0'
51
+ - !ruby/object:Gem::Dependency
52
+ name: mini_racer
53
+ requirement: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ type: :runtime
59
+ prerelease: false
60
+ version_requirements: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
51
65
  - !ruby/object:Gem::Dependency
52
66
  name: bundler
53
67
  requirement: !ruby/object:Gem::Requirement
@@ -451,8 +465,10 @@ files:
451
465
  - assets/img/hero.png
452
466
  - assets/img/project-images/project-placeholder.png
453
467
  - assets/img/team-images/team-placeholder.png
454
- - assets/js/main.js
468
+ - assets/js/anchor.js
469
+ - assets/js/private_eye_conf.js
455
470
  - assets/js/vendor/anchor.min.js
471
+ - assets/js/vendor/private_eye.js
456
472
  - assets/uswds/fonts/merriweather/Latin-Merriweather-Black.ttf
457
473
  - assets/uswds/fonts/merriweather/Latin-Merriweather-Black.woff
458
474
  - assets/uswds/fonts/merriweather/Latin-Merriweather-Black.woff2
@@ -712,7 +728,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
712
728
  - !ruby/object:Gem::Version
713
729
  version: '0'
714
730
  requirements: []
715
- rubygems_version: 3.1.4
731
+ rubygems_version: 3.2.6
716
732
  signing_key:
717
733
  specification_version: 4
718
734
  summary: A Jekyll theme for the U.S. Web Design System.