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 = {
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.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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 >
99export 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}
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments