Skip to content

Commit

Permalink
Add params
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Nov 2, 2020
1 parent c98bffe commit 22e08f9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ import * as data from 'core/util/data.json';
import { hello3 } from 'core/util/hello3';
// From main
import { hello4 } from './lib';
// From the Hugo template.
import * as params from '@params';

window.hello1 = hello1;
window.hello2 = hello2;
window.hello3 = hello3;
window.hello4 = hello4;
window.data = data;
window.params = params;
4 changes: 2 additions & 2 deletions assets/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"baseUrl": ".",
"paths": {
"*": [
"../../hugoTestModulesJS/mod1/assets/*",
"../../hugoTestModulesJS/mod2/assets/*"
"../../../../hugo_cache/modules/filecache/modules/pkg/mod/github.com/gohugoio/hugo!test!modules!j!s/mod1@v0.1.0/assets/*",
"../../../../hugo_cache/modules/filecache/modules/pkg/mod/github.com/gohugoio/hugo!test!modules!j!s/mod2@v0.1.0/assets/*"
]
}
}
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ github.com/gohugoio/hugoTestModulesJS/mod1 v0.0.0-20201010100603-5c7000b063e3 h1
github.com/gohugoio/hugoTestModulesJS/mod1 v0.0.0-20201010100603-5c7000b063e3/go.mod h1:IfctxwCwBB4wVUA+bUb4o5x2mvphWPXVLhKaclkpwz4=
github.com/gohugoio/hugoTestModulesJS/mod1 v0.0.0-20201011174806-5f7e20f9ff4a h1:h/+C4m4Aav50zgU2pfm2+GpuhoEgwVKkiRhDK2fjADs=
github.com/gohugoio/hugoTestModulesJS/mod1 v0.0.0-20201011174806-5f7e20f9ff4a/go.mod h1:IfctxwCwBB4wVUA+bUb4o5x2mvphWPXVLhKaclkpwz4=
github.com/gohugoio/hugoTestModulesJS/mod1 v0.1.0/go.mod h1:IfctxwCwBB4wVUA+bUb4o5x2mvphWPXVLhKaclkpwz4=
github.com/gohugoio/hugoTestModulesJS/mod2 v0.0.0-20201011192008-decf54abafdd h1:Uu3lXkigL0q13sVksE7NVnoPTyxx4ViYKrNA70QDKA4=
github.com/gohugoio/hugoTestModulesJS/mod2 v0.0.0-20201011192008-decf54abafdd/go.mod h1:uynOkor8I03PIUuDZN4NYQ+Bmkye7vNLV5tRUBC2+10=
github.com/gohugoio/hugoTestModulesJS/mod2 v0.1.0/go.mod h1:uynOkor8I03PIUuDZN4NYQ+Bmkye7vNLV5tRUBC2+10=
3 changes: 2 additions & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>
{{ .Title }}
</title>
{{ $js := resources.Get "js/main.js" | js.Build (dict "minify" false ) }}
{{ $js := resources.Get "js/main.js" | js.Build (dict "minify" false "params" (dict "myparam" "Hugo Rocks!!!!!!") ) }}
<script src="{{ $js.RelPermalink }}"></script>
{{ partialCached "jslibs/alpinejs/script-src.html" "-" }}
</head>
Expand All @@ -17,5 +17,6 @@
<li x-text="hello3()"></li>
<li x-text="hello4()"></li>
<li x-text="data.Hugo"></li>
<li x-text="params.myparam"></li>
</ul>
</div>

0 comments on commit 22e08f9

Please sign in to comment.