Skip to content

Commit 336bf39

Browse files
committed
chore(nuxt): disable document driven for static
1 parent 93564c4 commit 336bf39

File tree

3 files changed

+41
-35
lines changed

3 files changed

+41
-35
lines changed

app/nuxt.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
export default defineNuxtConfig({
2+
devtools: { enabled: true },
23
extends: '../',
3-
4-
// pass USE_STATIC to env when use "pnpm generate" for client only rendering support in @nuxt/content
5-
ssr: process.env.USE_STATIC ? false : undefined,
6-
nitro: process.env.USE_STATIC ? { preset: 'service-worker' } : undefined,
74
})

nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default defineNuxtConfig({
8080

8181
// module::content
8282
content: {
83-
documentDriven: true,
83+
// documentDriven: true,
8484
markdown: {
8585
mdc: true,
8686
},

pages/post/index.vue

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,49 @@ useHead({ title: 'Posts' })
99
<LayoutPageHeader>
1010
<LayoutPageTitle text="Posts" class="capitalize" />
1111
</LayoutPageHeader>
12-
<ContentList v-slot="{ list }" path="/post">
13-
<LayoutPageSection v-for="article in list" :key="article._path">
14-
<div
15-
class="hover:no-underline p-6 flex space-x-6 rounded border border-gray-900/10 dark:border-gray-50/[0.2]"
16-
>
17-
<div class="mt-1 text-gray-600 dark:text-gray-400 text-right">
18-
<div>{{ article.date }}</div>
19-
<AwesomeLink
20-
class="text-sm flex items-center justify-end space-x-1"
21-
:href="`https://www.github.com/${article.author}`"
22-
>
23-
<Icon name="mdi:github-face" class="text-xs" />
24-
<span>{{ article.author }}</span>
25-
</AwesomeLink>
26-
</div>
27-
<div class="flex flex-col">
28-
<div class="text-xl font-semibold text-gray-800 dark:text-gray-50">
29-
{{ article.title }}
30-
</div>
31-
<div class="text-gray-700 dark:text-gray-300 mb-1">
32-
{{ article.description }}
33-
</div>
34-
<div class="flex">
12+
<LayoutPageSection>
13+
<ContentList path="/post">
14+
<template #default="{ list }">
15+
<div
16+
v-for="article in list"
17+
:key="article._path"
18+
class="hover:no-underline p-6 flex space-x-6 rounded border border-gray-900/10 dark:border-gray-50/[0.2] mb-4"
19+
>
20+
<div class="mt-1 text-gray-600 dark:text-gray-400 text-right">
21+
<div>{{ article.date }}</div>
3522
<AwesomeLink
36-
class="text-sm flex space-x-1 items-center text-primary-500"
37-
:to="article._path"
23+
class="text-sm flex items-center justify-end space-x-1"
24+
:href="`https://www.github.com/${article.author}`"
3825
>
39-
<span>learn more</span>
40-
<Icon name="ic:baseline-arrow-right-alt" class="text-sm" />
26+
<Icon name="mdi:github-face" class="text-xs" />
27+
<span>{{ article.author }}</span>
4128
</AwesomeLink>
4229
</div>
30+
<div class="flex flex-col">
31+
<div
32+
class="text-xl font-semibold text-gray-800 dark:text-gray-50"
33+
>
34+
{{ article.title }}
35+
</div>
36+
<div class="text-gray-700 dark:text-gray-300 mb-1">
37+
{{ article.description }}
38+
</div>
39+
<div class="flex">
40+
<AwesomeLink
41+
class="text-sm flex space-x-1 items-center text-primary-500"
42+
:to="article._path"
43+
>
44+
<span>learn more</span>
45+
<Icon name="ic:baseline-arrow-right-alt" class="text-sm" />
46+
</AwesomeLink>
47+
</div>
48+
</div>
4349
</div>
44-
</div>
45-
</LayoutPageSection>
46-
</ContentList>
50+
</template>
51+
<template #not-found>
52+
<p>No articles found.</p>
53+
</template>
54+
</ContentList>
55+
</LayoutPageSection>
4756
</LayoutPageWrapper>
4857
</template>

0 commit comments

Comments
 (0)