123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <template>
- <Layout>
- <!-- 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">
- <div class="section-title">
- Sommaire
- </div>
- <div class="column justify-end table-of-content">
- <span
- v-for="edge in $page.chapitres.edges.slice().reverse()"
- :key="`sommaire${edge.node.id}`"
- >
- <a :href="'#chapitres'+edge.node.id">{{ edge.node.Titre }}</a>
- </span>
- </div>
- </div>
- <div v-for="edge in $page.chapitres.edges.slice().reverse()" :key="`chapitres${edge.node.id}`">
- <h2
- :id="`chapitres${edge.node.id}`"
- class="chapter-title canbreak"
- >{{edge.node.titre}}</h2>
- <VueMarkdown
- class="chapter-content justify"
- >{{edge.node.contenu}}
- </VueMarkdown>
- </div>
- </Layout>
- </template>
- <script>
- import { Previewer } from 'pagedjs'
- import VueMarkdown from 'vue-markdown'
- export default {
- components: {
- VueMarkdown
- },
- mounted(){
- this.$nextTick(()=>{
- let previewer = new Previewer();
- previewer.preview();
- })
- }
- }
- </script>
- <page-query>
- query {
- chapitres: allChapitres {
- edges {
- node {
- id
- Titre
- Contenu
- }
- }
- }
- introductions: allIntroductions {
- edges {
- node {
- id
- contenu
- }
- }
- }
- }
- </page-query>
|