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:
Diffstat (limited to 'README.md')
-rw-r--r--README.md31
1 files changed, 31 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();
+
+})();
+
+```
+