Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 061bf2a

Browse files
committed
fix(example): fix multiple-content-types example config and pages
related to #83
1 parent 28fbc6a commit 061bf2a

File tree

5 files changed

+23
-29
lines changed

5 files changed

+23
-29
lines changed

examples/multiple-content-types/nuxtent.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ module.exports = {
33
[
44
'posts',
55
{
6-
page: '/_post',
7-
permalink: ':year/:slug',
6+
page: '/posts/_slug',
7+
permalink: '/:year/:slug',
88
generate: ['get', 'getAll']
99
}
1010
],
1111
[
1212
'projects',
1313
{
14-
page: '/projects/slug',
15-
permalink: '/:slug',
14+
page: '/projects/_slug',
15+
permalink: '/projects/:slug',
1616
isPost: false,
1717
generate: ['get', 'getAll']
1818
}
File renamed without changes.

examples/multiple-content-types/pages/projects.vue

Lines changed: 0 additions & 21 deletions
This file was deleted.

examples/multiple-content-types/pages/projects/_slug.vue renamed to examples/multiple-content-types/pages/projects/_slug/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<section class="container">
3-
<h1> Project: {{ project.name }} </h1>
3+
<h1>Project: {{ project.name }}</h1>
44
<nuxtent-body :body="project.body" />
55
</section>
66
</template>
@@ -9,7 +9,7 @@
99
export default {
1010
async asyncData ({ app, route }) {
1111
return {
12-
project: await app.$content('/projects').get(route.params.slug)
12+
project: await app.$content('/projects').get(route.path)
1313
}
1414
}
1515
}
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
<template>
22
<section class="container">
3-
<h1> Project </h1>
4-
See all my projects!
3+
<h1>Projects</h1>
4+
<ul>
5+
<li v-for="project in projects">
6+
<nuxt-link :to="project.permalink">{{ project.name }}</nuxt-link>
7+
</li>
8+
</ul>
9+
<nuxt-child />
510
</section>
611
</template>
12+
13+
<script>
14+
export default {
15+
async asyncData ({ app }) {
16+
return {
17+
projects: await app.$content('/projects').getAll()
18+
}
19+
}
20+
}
21+
</script>

0 commit comments

Comments
 (0)