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