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:36:30 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-10-06 18:36:30 +0300
commit156ac713ccaecbc9bbf402ff09f6f2455798ec2f (patch)
treef0be050b2353c0c833d2a8ca870511e1309f35cf /alpinejs
parent3e00795644ec2d28c54d04c18b11b65406ae2357 (diff)
alpinejs: Move readme, add version info
Diffstat (limited to 'alpinejs')
-rw-r--r--alpinejs/README.md32
1 files changed, 32 insertions, 0 deletions
diff --git a/alpinejs/README.md b/alpinejs/README.md
new file mode 100644
index 0000000..94eb2c9
--- /dev/null
+++ b/alpinejs/README.md
@@ -0,0 +1,32 @@
+This module mounts [AlpineJS](https://github.com/alpinejs/alpine)'s `packages/.../dist` folders.
+
+See [Releases](https://github.com/gohugoio/hugo-mod-jslibs-dist/releases) for version information. The version scheme used is Alpine's version with the patch number multiplied with 100, e.g. `v3.4.2` becomes `alpinejs/v3.4.200`.
+
+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();
+
+})();
+
+```