feat: update hx-get directive target
All checks were successful
/ Build (push) Successful in 1m3s

This commit is contained in:
log101 2024-05-30 13:16:29 +03:00
parent 3b46305c63
commit 17c86c0926

View File

@ -8,6 +8,8 @@ import Post from "@/components/Post.astro";
const { entry } = Astro.props; const { entry } = Astro.props;
const host = import.meta.env.PROD ? import.meta.env.SITE : "http://localhost";
export async function getStaticPaths() { export async function getStaticPaths() {
const blogEntries = await getCollection("blog"); const blogEntries = await getCollection("blog");
return blogEntries.map((entry) => ({ return blogEntries.map((entry) => ({
@ -33,7 +35,7 @@ export async function getStaticPaths() {
<Header /> <Header />
<Post post={entry} componentType="full" /> <Post post={entry} componentType="full" />
<div <div
hx-get=`http://localhost:8000/forms/emoji?postId=${entry.id}` hx-get=`${host}/api/forms/emoji?postId=${entry.id}`
hx-trigger="load" hx-trigger="load"
hx-swap="innerHTML" hx-swap="innerHTML"
> >