Skip to content

Commit

Permalink
basic playground app
Browse files Browse the repository at this point in the history
  • Loading branch information
vernaillen committed Aug 10, 2024
1 parent b15b83d commit d5445f6
Show file tree
Hide file tree
Showing 8 changed files with 25,858 additions and 13,124 deletions.
8 changes: 0 additions & 8 deletions playground/app.vue

This file was deleted.

7 changes: 7 additions & 0 deletions playground/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default defineAppConfig({
ui: {
variables: {

}
}
})
6 changes: 6 additions & 0 deletions playground/app/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<template>
<div>
<NuxtPage />
<StagingBanner />
</div>
</template>
43 changes: 43 additions & 0 deletions playground/app/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<script setup lang="ts">
const { data: pages } = await useWPPages()
const { data: posts } = await useWPPosts()
</script>

<template>
<div>
<header class="prose max-w-5xl mx-auto p-5">
Pages:
<span
v-for="page, index in pages"
:key="index"
>
<NuxtLink
v-if="page.slug"
:to="'/' + page.slug"
>
{{ page.title }}
</NuxtLink>
<span v-if="index !== pages.length - 1"> - </span>
</span>
<br>
Posts:
<span
v-for="post, index in posts"
:key="index"
>
<NuxtLink
v-if="post.slug"
:to="'/' + post.slug"
>
{{ post.title }}
</NuxtLink>
<span v-if="index !== posts.length - 1"> - </span>
</span>
<br>
</header>
<hr>
<main class="prose max-w-5xl mx-auto p-5">
<slot />
</main>
</div>
</template>
20 changes: 20 additions & 0 deletions playground/app/pages/[...slug].vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script setup lang="ts">
import { useRoute } from 'nuxt/app'
const route = useRoute()
const post = ref<PostFragment | PageFragment | undefined>()
if (route.params.slug && route.params.slug[0]) {
const { data } = await useWPNodeByUri({ uri: route.params.slug[0] })
post.value = data.value
}
definePageMeta({
colorMode: 'light'
})
</script>

<template>
<NuxtLayout>
<BlockRenderer :blocks="post?.editorBlocks" />
</NuxtLayout>
</template>
Loading

0 comments on commit d5445f6

Please sign in to comment.