Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugoTestProjectJSModImports.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-11-02 19:51:33 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-11-02 19:51:33 +0300
commit22e08f9dbda1764446f154967b2e1e5bb10e6191 (patch)
tree62c5976c03cebc4cf6ed3fc6992e95b0931f5c19
parentc98bffeaf761d20d5517bcbecb65f71048d000c2 (diff)
Add params
-rw-r--r--assets/js/main.js3
-rw-r--r--assets/jsconfig.json4
-rw-r--r--go.sum2
-rw-r--r--layouts/index.html3
4 files changed, 9 insertions, 3 deletions
diff --git a/assets/js/main.js b/assets/js/main.js
index 3d03b53..ac41e01 100644
--- a/assets/js/main.js
+++ b/assets/js/main.js
@@ -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;
diff --git a/assets/jsconfig.json b/assets/jsconfig.json
index aaa17c7..31ed517 100644
--- a/assets/jsconfig.json
+++ b/assets/jsconfig.json
@@ -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/*"
]
}
}
diff --git a/go.sum b/go.sum
index 878c765..eadbfca 100644
--- a/go.sum
+++ b/go.sum
@@ -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=
diff --git a/layouts/index.html b/layouts/index.html
index 2f8a43d..7fc60fa 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -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>
@@ -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> \ No newline at end of file