mirror of
https://github.com/acaloiaro/hugo-htmx-go-template
synced 2026-07-21 18:29:14 +00:00
1.3 KiB
1.3 KiB
| title | date | draft |
|---|---|---|
| Hello, World! | 2023-06-24T15:58:00-06:00 | false |
Let's dynamically fetch content from our API.
What you're currently reading is typical Hugo content authored in Markdown. Below the break we see content loaded dynamically via HTMX from our API server.
Open content/posts/hello-world.md to follow along with the code.
{{< htmx.inline >}}
Content loading from API...
Let's add a form
Writing markdown content is great, but sometimes you want to add hypermedia controls: buttons, forms, etc.
See func helloWorldForm from server.go to see what's going on behind the scenes with this form.
Here we are using a Hugo concept called an "inline shortcode". This allows us to change the base URL for our API server, depending on whether we're in development or production.
{{< htmx.inline >}}
Name{{< /htmx.inline >}}