Adding umbrellajs, an tiny jquery replacement. Switching theme js to umbrellajs.
This commit is contained in:
parent
6ef1e420e3
commit
d0a11e1ad4
1 changed files with 848 additions and 33 deletions
34
README.md
34
README.md
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue