Browse Source

Ajout des rubriques

Tibo 4 years ago
parent
commit
d4c2d0a690

+ 0 - 1
README.md

@@ -89,5 +89,4 @@ git push
 ## Todo
 
 - Traits de coupes
-- Introduction / conclusion (possiblité de rubrique)
 - Pages citations

+ 1 - 0
gridsome.server.js

@@ -16,6 +16,7 @@ module.exports = function (api) {
         id: item.id,
         titre: item.titre,
         contenu: item.contenu,
+        rubrique: item.rubrique,
       })
     }
     let data_sections = await axios.get('https://popsu.strapi.figli.io/sections')

+ 1 - 1
src/.temp/now.js

@@ -1 +1 @@
-export default 1563530197593
+export default 1563531149355

+ 3 - 0
src/css/styles_de_caracteres.scss

@@ -11,6 +11,9 @@
 .center{
 	text-align: center;
 }
+.align-right{
+	text-align: right;
+}
 // Notes de fin de chapitres
 [data-note] {
 	position: relative;

+ 5 - 0
src/css/styles_de_paragraphes.scss

@@ -66,6 +66,11 @@
 	font-size: 10pt;
 	letter-spacing: 4pt;
 }
+.chapter-title::before{
+	content: attr(data-rubrique);
+	display: block;
+	@extend .section-title;
+}
 .chapter-content {
 	hyphens: auto;
 	font-family: "Cormorant";

+ 2 - 2
src/pages/Index.vue

@@ -43,7 +43,7 @@
   <div class="blank-page no-folio"></div>
   <!-- Chapitres -->
       <div class="hyphen" v-for="(edge,index) in $page.chapters.edges.slice().reverse()" :key="'chapter'+edge.node.id">
-        <h2 v-bind:id="'chapter'+edge.node.id" class="chapter-title" v-bind:class="{ canbreak: isNotFirst(index) }" >{{ edge.node.titre }}</h2>
+        <h2 v-bind:data-rubrique="edge.node.rubrique" v-bind:id="'chapter'+edge.node.id" class="chapter-title" v-bind:class="{ canbreak: isNotFirst(index) }" >{{ edge.node.titre }}</h2>
           <VueMarkdown lang="fr" class="chapter-content justify">{{edge.node.contenu}}</VueMarkdown>
       </div>
       <!-- Notes de fin de document -->
@@ -74,7 +74,7 @@
 <page-query>
   {
     chapters : allchapitres{
-      edges{node{id,titre,contenu}}
+      edges{node{id,titre,contenu,rubrique}}
     }
     sections : allsections{
       edges{node{id,titre,contenu}}

+ 0 - 5
src/pages/README.md

@@ -1,5 +0,0 @@
-Pages are usually used for normal pages or for listing items from a GraphQL collection.
-Add .vue files here to create pages. For example **About.vue** will be **site.com/about**.
-Learn more about pages: https://gridsome.org/docs/pages
-
-You can delete this file.