#Trying to make a blog with builder io
7 messages · Page 1 of 1 (latest)
they have a blue print but it does not seem to work
the example i provided gets the blog index to generate but thats about it
with issues but im prolly just going to create a page and use the sections to generate the blog index for now
Builder.io Forum
I am trying to create a article section on a page following along with the blue print for blog article docs. Error Cannot read properties of undefined (reading 'article') /home/jack/qwikuplift/src/routes/blog/[....all]/index.jsx:9:40 7 | 8 | 9 | export default component$(({ params: { article } }) => { | ...
i made this post it has more info
import { component$, Resource, useResource$} from "@builder.io/qwik";
import { DocumentHead, routeLoader$ } from "@builder.io/qwik-city";
import { fetchOneEntry, RenderContent} from "@builder.io/sdk-qwik";
export const BUILDER_PUBLIC_API_KEY = "758eba9573244c6b8c2affff6df8e733";
export default component$(() => {
const articleRsrc = useResource$(() =>
fetchOneEntry({
model: "blog-index",
apiKey: BUILDER_PUBLIC_API_KEY,
options: { includeRefs: true },
})
);
return (
<Resource
value={articleRsrc}
onPending={() => <div>Loading article...</div>}
onResolved={(article) => (
<>
<div>
<div>{article.data.title}</div>
<RenderContent
model="blog-index"
content={article}
apiKey={BUILDER_PUBLIC_API_KEY}
options={{ includeRefs: true }}
/>
</div>
</>
)}
/>
);
});