This repository was archived by the owner on Feb 2, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +23
-29
lines changed
examples/multiple-content-types Expand file tree Collapse file tree 5 files changed +23
-29
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,16 @@ module.exports = {
3
3
[
4
4
'posts' ,
5
5
{
6
- page : '/_post ' ,
7
- permalink : ':year/:slug' ,
6
+ page : '/posts/_slug ' ,
7
+ permalink : '/ :year/:slug' ,
8
8
generate : [ 'get' , 'getAll' ]
9
9
}
10
10
] ,
11
11
[
12
12
'projects' ,
13
13
{
14
- page : '/projects/slug ' ,
15
- permalink : '/:slug' ,
14
+ page : '/projects/_slug ' ,
15
+ permalink : '/projects/ :slug' ,
16
16
isPost : false ,
17
17
generate : [ 'get' , 'getAll' ]
18
18
}
File renamed without changes.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<section class =" container" >
3
- <h1 > Project: {{ project.name }} </h1 >
3
+ <h1 >Project: {{ project.name }}</h1 >
4
4
<nuxtent-body :body =" project.body" />
5
5
</section >
6
6
</template >
9
9
export default {
10
10
async asyncData ({ app, route }) {
11
11
return {
12
- project: await app .$content (' /projects' ).get (route .params . slug )
12
+ project: await app .$content (' /projects' ).get (route .path )
13
13
}
14
14
}
15
15
}
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<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 />
5
10
</section >
6
11
</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 >
You can’t perform that action at this time.
0 commit comments