Skip to content

Commit

Permalink
Add 'load content' button example
Browse files Browse the repository at this point in the history
  • Loading branch information
acaloiaro committed Jul 4, 2023
1 parent 9e3c6c2 commit 6caf7d2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions content/posts/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,17 @@ Here we are using a Hugo concept called an "inline shortcode". This allows us to
</form>
{{< /htmx.inline >}}


---

## Let's add a simple button that loads content

{{< htmx.inline >}}
<div
hx-get="/content.html"
hx-trigger="click" />
<button>Load content</button>
</div>
{{< /htmx.inline >}}


1 change: 1 addition & 0 deletions partials/content.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>This content is dynamically loaded from <strong>partials/content.html</strong>.</p>

0 comments on commit 6caf7d2

Please sign in to comment.