aboutsummaryrefslogtreecommitdiff
path: root/scripts/htmx.setup.sh
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-03-07 15:09:42 +0530
committerBobby <[email protected]>2026-03-07 15:09:42 +0530
commit8f8d41413ff775b6d721059783a0e2de4f90f50c (patch)
tree40923d049ee7df8b0bc90d74373c94cdd4d8b230 /scripts/htmx.setup.sh
parent41926c10ea2e8496ce4b528262f5047ccbe6f155 (diff)
downloaddove-8f8d41413ff775b6d721059783a0e2de4f90f50c.tar.xz
dove-8f8d41413ff775b6d721059783a0e2de4f90f50c.zip
feat: add configuration management and server setup
- Implemented configuration file creation and loading in config.go. - Added default configuration content embedded in embed.go. - Introduced logging middleware for HTTP requests. - Created Makefile for build and setup automation. - Integrated Tailwind CSS and HTMX for frontend styling and interactivity. - Developed basic authentication flow with login and dashboard pages. - Enhanced error handling and user feedback in templates. - Updated dependencies in go.mod and go.sum.
Diffstat (limited to 'scripts/htmx.setup.sh')
-rw-r--r--scripts/htmx.setup.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/htmx.setup.sh b/scripts/htmx.setup.sh
new file mode 100644
index 0000000..b8d6fe6
--- /dev/null
+++ b/scripts/htmx.setup.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+set -e
+
+STATIC_JS_DIR="static/js"
+HTMX_FILE="$STATIC_JS_DIR/htmx.min.js"
+
+echo "Fetching latest HTMX release..."
+LATEST_RELEASE=$(curl -s https://api.github.com/repos/bigskysoftware/htmx/releases/latest | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
+
+if [ -z "$LATEST_RELEASE" ]; then
+ echo "Failed to fetch latest release, using default version 2.0.8."
+ LATEST_RELEASE="2.0.8"
+fi
+
+echo "Latest version: $LATEST_RELEASE"
+DOWNLOAD_URL="https://unpkg.com/htmx.org@${LATEST_RELEASE}/dist/htmx.min.js"
+
+echo "Downloading from: $DOWNLOAD_URL"
+echo ""
+
+mkdir -p "$STATIC_JS_DIR"
+
+if curl -fSL "$DOWNLOAD_URL" -o "$HTMX_FILE"; then
+ echo ""
+ echo "HTMX installed successfully!"
+ echo "Location: $HTMX_FILE"
+ echo "Version: $LATEST_RELEASE"
+else
+ echo ""
+ echo "Failed to download HTMX."
+ exit 1
+fi