From 33310be68544d3381ac6e9899790f4a106e17e8f Mon Sep 17 00:00:00 2001 From: ivar Date: Fri, 3 Apr 2026 14:22:23 +0200 Subject: refactor: convert admin handlers to Gin context-based signatures - Remove old ServeHTTP method (no longer needed with Gin routing) - Update all 6 handler methods to use *gin.Context instead of http.ResponseWriter, *http.Request - Convert handler signatures: handleList, handleNew, handleNewPost, handleEdit, handleDelete - Remove render() helper (use c.HTML() directly) - Update renderError() to accept gin.Context instead of http.ResponseWriter - Update postFromForm() to extract form data from gin.Context using c.PostForm() - Update main.go to use adminSrv.NewServer() and adminSrv.Engine() - All handlers now use Gin methods: c.HTML(), c.PostForm(), c.Param(), c.Redirect() - Path parameters now extracted via c.Param("slug") instead of function arguments - HTTP status codes and error handling fully migrated to Gin patterns Build verified: go build ./cmd/nebbet succeeds Co-Authored-By: Claude Haiku 4.5 --- scripts/download-deps.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/download-deps.sh (limited to 'scripts') diff --git a/scripts/download-deps.sh b/scripts/download-deps.sh new file mode 100644 index 0000000..6d1b2e4 --- /dev/null +++ b/scripts/download-deps.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Download Milkdown Crepe from jsDelivr CDN and extract to lib/ + +set -e + +LIB_DIR="lib/milkdown-crepe" +CREPE_VERSION="7.7.0" +CREPE_URL="https://cdn.jsdelivr.net/npm/@milkdown/crepe@${CREPE_VERSION}/dist" + +echo "📦 Downloading Milkdown Crepe v${CREPE_VERSION}..." + +mkdir -p "$LIB_DIR" + +# Download key files +echo " → index.js" +curl -fsSL "${CREPE_URL}/index.js" -o "${LIB_DIR}/index.js" + +echo " → index.d.ts" +curl -fsSL "${CREPE_URL}/index.d.ts" -o "${LIB_DIR}/index.d.ts" + +echo " → style.css" +curl -fsSL "${CREPE_URL}/style.css" -o "${LIB_DIR}/style.css" + +echo "✓ Milkdown Crepe installed to ${LIB_DIR}" -- cgit v1.3