diff --git a/src/content/blog/astro-htmx.md b/src/content/blog/astro-htmx.md deleted file mode 100644 index c2a43eb..0000000 --- a/src/content/blog/astro-htmx.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "Astro and HTMX: An Interesting Stack" -description: Strap a horse on a rocket and use Astro Partials to stream UI components via HTMX. -date: "2024-09-10" -draft: true -link: https://github.com/zeucapua/ ---- - -### What is HTMX? - -### Astro Partials - -### Using HTMX Attributes - -### Forms and Values via Astro Partials - -### Streaming in Client Components as Astro Islands diff --git a/src/content/blog/rash-stack.md b/src/content/blog/rash-stack.md new file mode 100644 index 0000000..f3935b6 --- /dev/null +++ b/src/content/blog/rash-stack.md @@ -0,0 +1,100 @@ +--- +title: "The RASH Stack: React, Astro, Svelte, HTMX" +description: Strap a horse on a rocket and use Astro Partials to stream UI components via HTMX. +date: "2024-09-10" +draft: true +link: https://github.com/zeucapua/ +--- + +## The Project + +I'm building a Notion-like note taking system that'll (probably) make me more productive with as +little fluff and features as possible. Each block can be added, edited, and deleted freely, with +the full page data is saved locally. + +For the features to demo the RASH stack, we are making: +- Plain text (Astro + HTMX) +- Checkbox (Svelte) +- Whiteboard (React via tldraw library) + +## What is HTMX? + +The basic idea behind HTMX is that APIs should return HTML that shows the updated part of the page +after a request. For example, let's make a button that adds our feature, simple plain text input: + +```html +

Hodgepodge App

+ + + +``` + +The button has a few new attributes to use HTMX: `hx-post` specifies a `POST` API request +at the endpoint `/addTextBlock`; `hx-target` is to determine what element we want to update; +`hx-swap` tells us how we should handle the HTML after the response, in this case adding the +response before the button. Now the endpoint can return HTML like so... + +```html +