mirror of
https://github.com/acaloiaro/hugo-htmx-go-template
synced 2026-07-21 10:12:25 +00:00
Replace hard-coded API calls with .Site.Params.apiBaseUrl
This commit is contained in:
parent
e883eefcfc
commit
9e3c6c2efa
1 changed files with 3 additions and 3 deletions
|
|
@ -12,15 +12,15 @@ Open `content/posts/hello-world.md` to follow along with the code.
|
|||
|
||||
---
|
||||
|
||||
{{< html.inline >}}
|
||||
{{< htmx.inline >}}
|
||||
<div
|
||||
hx-get="http://localhost:1314/hello_world"
|
||||
hx-get="{{ .Site.Params.apiBaseUrl }}/hello_world"
|
||||
hx-trigger="load"
|
||||
hx-vals='js:{"name": new URLSearchParams(window.location.search).get("name")}'
|
||||
hx-on="htmx:configRequest: console.log('detail:', event.detail); event.detail.headers='';" />
|
||||
<p>Content loading from API...</p>
|
||||
</div>
|
||||
{{< /html.inline >}}
|
||||
{{< /htmx.inline >}}
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue