Adding umbrellajs, an tiny jquery replacement. Switching theme js to umbrellajs.

This commit is contained in:
Fredrik Jonsson 2019-03-20 05:16:25 +01:00
commit d0a11e1ad4

View file

@ -29,6 +29,7 @@ This is originally a port of the [Zen](https://www.drupal.org/project/zen) theme
* RSS and JSON feeds with full content
* Search with DuckDuckGo
* Sub theme support (Theme Components)
* Umbrella JS 3 (tiny jQuery replacement, 2.5kB when gzipped)
## Sites using the Hugo Zen theme
@ -217,6 +218,39 @@ The <strong>content</strong> that should be wrapped.
```
## Choose between using jQuery or Umbrella JS
Umbrella JS is always added and it's used for all theme JavaScript. To add jQuery, set the related parameter to true in the configuration file or in the front matter of specific pages. No problem having both libraries loaded on the same page.
This is the way I construct my JavaScript files.
**Umbrella JS:**
```
(function ($) {
'use strict';
// Add your code here.
$('html').removeClass('nojs').addClass('js');
})(u);
```
**jQuery:**
```
(function ($) {
'use strict';
// Add your code here.
$('html').removeClass('nojs').addClass('js');
})(jQuery);
```
## Use Gulp to lint Sass and JavaScript
* Lint your Sass using sass-lint.