From 22e08f9dbda1764446f154967b2e1e5bb10e6191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 2 Nov 2020 17:51:33 +0100 Subject: [PATCH] Add params --- assets/js/main.js | 3 +++ assets/jsconfig.json | 4 ++-- go.sum | 2 ++ layouts/index.html | 3 ++- 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 }} - {{ $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!!!!!!") ) }} {{ partialCached "jslibs/alpinejs/script-src.html" "-" }} @@ -17,5 +17,6 @@
  • +
  • \ No newline at end of file