-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from 18F/default-assets
Use USWDS CSS and JS by default
- Loading branch information
Showing
4 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1 @@ | ||
title: This is the site title | ||
|
||
styles: | ||
- /assets/uswds/css/uswds.min.css | ||
|
||
scripts: | ||
- src: /assets/uswds/js/uswds.min.js | ||
async: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
{% assign _scripts = '' | split: '' | push: site.scripts | push: layout.scripts | push: page.scripts | uniq %} | ||
{% 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 %} | ||
{% endunless %} | ||
{% assign _scripts = _scripts | ||
| push: _site_scripts | ||
| push: layout.scripts | ||
| push: page.scripts | ||
| uniq %} | ||
{% for _list in _scripts %}{% for _script in _list %} | ||
<script src="{{ _script.src | default: _script | relative_url }}" {% if _script.async %}async{% endif %}></script> | ||
{% assign _src = _script.src | default: _script %} | ||
<script src="{{ _src | replace: _async_marker, '' | relative_url }}"{% if _script.async or _src contains _async_marker %} async{% endif %}></script> | ||
{% endfor %}{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
Gem::Specification.new do |spec| | ||
spec.name = "jekyll-uswds" | ||
spec.version = "0.1.1" | ||
spec.version = "0.2.0" | ||
spec.authors = ["Shawn Allen"] | ||
spec.email = ["[email protected]"] | ||
|
||
|