Simplification gridsome.server.js / Ajout de l'introduction
This commit is contained in:
+1
-5
@@ -19,11 +19,7 @@ module.exports = function(api) {
|
||||
data
|
||||
} = res[index];
|
||||
for (const item of data) {
|
||||
action.addNode({
|
||||
id: item.id,
|
||||
titre: item.Titre,
|
||||
contenu: item.Contenu
|
||||
})
|
||||
action.addNode(item)
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
},
|
||||
"source": "https://popsu-rouen-en.strapi.figli.io/",
|
||||
"search": [
|
||||
"introductions",
|
||||
"chapitres",
|
||||
"sections"
|
||||
]
|
||||
|
||||
+21
-2
@@ -3,6 +3,15 @@
|
||||
|
||||
<!-- Mise en page -->
|
||||
|
||||
|
||||
<div v-for="edge in $page.introductions.edges.slice().reverse()" :key="`introductions${edge.node.id}`">
|
||||
<VueMarkdown
|
||||
class="chapter-content justify"
|
||||
>{{edge.node.contenu}}
|
||||
</VueMarkdown>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Sommaire -->
|
||||
|
||||
<div class="column no-folio">
|
||||
@@ -14,7 +23,7 @@
|
||||
v-for="edge in $page.chapitres.edges.slice().reverse()"
|
||||
:key="`sommaire${edge.node.id}`"
|
||||
>
|
||||
<a :href="'#chapitres'+edge.node.id">{{ edge.node.titre }}</a>
|
||||
<a :href="'#chapitres'+edge.node.id">{{ edge.node.Titre }}</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -56,10 +65,20 @@ export default {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
titre
|
||||
Titre
|
||||
Contenu
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
introductions: allIntroductions {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
contenu
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</page-query>
|
||||
|
||||
Reference in New Issue
Block a user