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

github.com/gohugoio/hugo-mod-jslibs-dist.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>2021-10-06 18:20:16 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-10-06 18:20:16 +0300
commit3e00795644ec2d28c54d04c18b11b65406ae2357 (patch)
treed784008926b53dcf558140356e27d1d78cd05be6
parente56f83a2ccbb13bc93d669cb55da2246b5715db7 (diff)
alpinejs: Add a mount and some README
-rw-r--r--README.md31
-rw-r--r--alpinejs/config.toml4
2 files changed, 35 insertions, 0 deletions
diff --git a/README.md b/README.md
index 7e3ae51..1f8b0fa 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,33 @@
# hugo-mod-jslibs-dist
+
Thin Hugo Module wrappers around some popular JS libs' distribution source code.
+
+The `packages` folder is mounted in `assets/jslibs/alpinejs/v3`.
+
+That means that you can just import it into your Hugo config:
+
+```toml
+[[module.imports]]
+path = "github.com/gohugoio/hugo-mod-jslibs-dist/alpinejs/v3"
+```
+
+And then use it in your JS files:
+
+```js
+import Alpine from 'jslibs/alpinejs/v3/alpinejs/dist/module.esm.js';
+import intersect from 'jslibs/alpinejs/v3/intersect/dist/module.esm.js';
+import persist from 'jslibs/alpinejs/v3/persist/dist/module.esm.js';
+
+// Set up and start Alpine.
+(function() {
+ // Register AlpineJS plugins.
+ Alpine.plugin(intersect);
+ Alpine.plugin(persist);
+
+ // Start Alpine.
+ Alpine.start();
+
+})();
+
+```
+
diff --git a/alpinejs/config.toml b/alpinejs/config.toml
new file mode 100644
index 0000000..ae22a01
--- /dev/null
+++ b/alpinejs/config.toml
@@ -0,0 +1,4 @@
+[module]
+[[module.mounts]]
+source = "packages"
+target = "assets/jslibs/alpinejs/v3"