-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intergrate Prismic.io
#14
Comments
prismicClient.jsMaak vervolgens een nieuwe directory in
import * as prismic from '@prismicio/client'
// Update your repository name here
const repositoryName = ''
const createClient = (params) => {
const client = prismic.createClient(repositoryName, params)
return client
}
export default createClient Het |
Fetch Prismic.io dataNu gaan we een endpoint maken om content te fetchen van de repo. Maak het bestand
import createClient from '$lib/prismicio'
export async function get({ fetch }) {
const client = createClient({ fetch })
const document = await client.getByUID('page', 'homepage')
if (document)
return {
body: {
document,
},
}
return {
status: 404,
}
} Deze endpoint heet + |
Render data using
|
Primsic.io connection
We gaan gebruik maken van twee packages om te werken met Prismic in Svelte.
@prismicio/client
is voor het fetching van content uit de APIThe text was updated successfully, but these errors were encountered: