forked from fdnd-task/lets-jam-webapplicatie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👽️ Render data using
@primicio/helpers
package #14
- Loading branch information
1 parent
8ca7a5d
commit 35c495a
Showing
8 changed files
with
101 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
}, | ||
"type": "module", | ||
"dependencies": { | ||
"@prismicio/helpers": "^2.3.8", | ||
"boxicons": "^2.1.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script> | ||
import { page } from "$app/stores"; | ||
</script> | ||
|
||
<nav> | ||
<h1>logo</h1> | ||
<ul> | ||
<li><a href="/">Home</a></li> | ||
<li><a href="/diensten">Diensten</a></li> | ||
<li><a href="/over">Over ons</a>/li> | ||
<li><a href="/contact">Contact</a></li> | ||
</ul> | ||
</nav> | ||
|
||
<style> | ||
/* NAV MENU */ | ||
nav { | ||
display: flex; | ||
max-width: 1000px; | ||
width: 100%; | ||
margin: 0 auto; | ||
justify-content: space-between; | ||
} | ||
ul{ | ||
display: flex; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script> | ||
import { page } from "$app/stores"; | ||
import Nav from "../components/+nav.svelte"; | ||
</script> | ||
|
||
<header> | ||
<Nav></Nav> | ||
</header> | ||
<slot/> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import createClient from "$lib/vendors/prismicClient.js"; | ||
|
||
export async function load({ fetch, request }) { | ||
|
||
const client = createClient({ fetch, request }) | ||
const documents = await client.getAllByType('homepage') | ||
|
||
if (documents) { | ||
return { | ||
documents | ||
} | ||
} | ||
|
||
return { | ||
status: 404, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
<h1>Welcome to SvelteKit</h1> | ||
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p> | ||
<script> | ||
import * as prismicH from "@prismicio/helpers"; | ||
export let data; | ||
const textfield = data.documents[0].data.ritch_text_field | ||
console.log(data.documents[0].data.ritch_text_field) | ||
</script> | ||
|
||
<h1>Dit is de home pagina</h1> | ||
|
||
<h2>api data</h2> | ||
{@html prismicH.asHTML(textfield)} | ||
|
||
<!-- <pre>{JSON.stringify(data, null, 2)}</pre> --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import createClient from "$lib/vendors/prismicClient.js"; | ||
|
||
export async function load({ fetch, request }) { | ||
|
||
const client = createClient({ fetch, request }) | ||
const documents = await client.getAllByType('page') | ||
|
||
if (documents) { | ||
return { | ||
documents | ||
} | ||
} | ||
|
||
return { | ||
status: 404, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<script> | ||
export let data; | ||
console.log(data.documents) | ||
</script> | ||
|
||
<h1>contact pagina</h1> | ||
|
||
<pre>{JSON.stringify(data, null, 2)}</pre> |
35c495a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
jbinstallatieservice – ./
jbinstallatieservice-m4tthys123.vercel.app
jbinstallatieservice-git-main-m4tthys123.vercel.app
jbinstallatieservice.vercel.app