-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs: load all JS files from node_modules
We load 3 JS files: 1. bootstrap.min.js 2. application.js (which has clipboard and the application code) 3. list.js (which has list.js) All 3 JS files are loaded asynchronously. In the future, if we need to call Bootstrap through its API, we might need to adapt the bundles.
- Loading branch information
Showing
9 changed files
with
147 additions
and
28 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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* eslint-env browser */ | ||
|
||
/* global List:false */ | ||
|
||
(function () { | ||
'use strict' | ||
|
||
new List('icons-body', { | ||
valueNames: ['name', { data: ['tags', 'categories'] }] | ||
}) | ||
})() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,17 +1,22 @@ | ||
{{- if or .IsHome (eq .Page.Layout "font") }} | ||
<script src="/assets/js/list.min.js"></script> | ||
<script> | ||
new List('icons-body', { | ||
valueNames: ['name', { data: ['tags', 'categories'] }] | ||
}); | ||
</script> | ||
{{ $bootstrapJs := resources.Get "/js/vendor/bootstrap.min.js" | resources.Copy "/assets/js/vendor/bootstrap.min.js" -}} | ||
<script async src="{{ $bootstrapJs.Permalink | relURL }}"></script> | ||
|
||
{{- if or .IsHome (eq .Page.Layout "font") -}} | ||
{{- $listVendor := resources.Get "js/vendor/list.min.js" -}} | ||
{{- $listJs := resources.Get "js/list.js" -}} | ||
{{- $listBundle := slice $listVendor $listJs | resources.Concat "assets/js/list.js" -}} | ||
|
||
{{- if eq hugo.Environment "production" -}} | ||
{{- $listBundle = $listBundle | resources.Minify -}} | ||
{{- end }} | ||
<script async src="{{ $listBundle.Permalink | relURL }}"></script> | ||
{{- end }} | ||
|
||
{{- $vendor := resources.Match "js/vendor/*.js" -}} | ||
{{- $js := resources.Match "js/*.js" -}} | ||
{{- $docsJs := append $js $vendor | resources.Concat "assets/js/application.js" -}} | ||
{{- $clipboardVendor := resources.Get "js/vendor/clipboard.min.js" -}} | ||
{{- $applicationJs := resources.Get "js/application.js" -}} | ||
{{- $applicationBundle := slice $clipboardVendor $applicationJs | resources.Concat "assets/js/application.js" -}} | ||
|
||
{{- if eq hugo.Environment "production" -}} | ||
{{- $docsJs = $docsJs | resources.Minify -}} | ||
{{- $applicationBundle = $applicationBundle | resources.Minify -}} | ||
{{- end }} | ||
<script async src="{{ $docsJs.Permalink | relURL }}"></script> | ||
<script async src="{{ $applicationBundle.Permalink | relURL }}"></script> |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.