Browse Source

Add "posts" section, archetype, …

Théophile Bastian 4 months ago
parent
commit
077d015361

+ 7 - 0
archetypes/posts.md

@@ -0,0 +1,7 @@
+---
+title: ""  # FIXME
+date: 2019-07-13T10:43:40+02:00  # FIXME?
+draft: true  # FIXME
+---
+
+Insérer l'article ici

+ 3 - 0
content/posts/_index.md

@@ -0,0 +1,3 @@
+---
+title: "Techniques, principes, …"
+---

+ 3 - 0
content/recettes/_index.md

@@ -0,0 +1,3 @@
+---
+title: "Les recettes"
+---

+ 9 - 0
layouts/index.html

@@ -4,5 +4,14 @@
 {{ define "main" }}
 {{ .Content }}
 
+{{ range where .Sections "Type" "==" "recettes" }}
+<h2 class="homepagecat">{{ .Title }}</h2>
 {{ partial "recipelist.html" . }}
 {{ end }}
+
+{{ range where .Sections "Type" "==" "posts" }}
+<h2 class="homepagecat">{{ .Title }}</h2>
+{{ partial "postlist.html" . }}
+{{ end }}
+
+{{ end }}

+ 5 - 0
layouts/partials/postlist.html

@@ -0,0 +1,5 @@
+<ul>
+  {{ range sort .Pages "Title" }}
+  <li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
+  {{ end }}
+</ul>

+ 1 - 3
layouts/partials/recipelist.html

@@ -1,6 +1,5 @@
-{{ range where .Sections "Type" "==" "recettes" }}
 {{ range sort .Sections "Params.homepage_index" }}
-<h2 class="recipecat">{{ .Title }}</h2>
+<h3 class="recipecat">{{ .Title }}</h3>
 
 <ul>
   {{ range sort .Pages "Title" }}
@@ -8,4 +7,3 @@
   {{ end }}
 </ul>
 {{ end }}
-{{ end }}

+ 4 - 0
scss/_params.scss

@@ -3,6 +3,10 @@
 $bg_color: #010018;
 $link_color: #2081c8;
 $fg_color: #e4e4e4;
+$title_base_color: #ffc467;
+$title_h1_color: lighten($title_base_color, 0%);
+$title_h2_color: lighten($title_base_color, 10%);
+$title_h3_color: lighten($title_base_color, 20%);
 $secondary_bg_color: #178ca7;
 $head_bg_color: $secondary_bg_color;
 $footer_fg_color: darken($fg_color, 30%);

+ 7 - 0
scss/style.scss

@@ -88,16 +88,19 @@ body {
 
   h1 {
     font-size: 1.4em;
+    color: $title_h1_color;
   }
 
   h2 {
     font-size: 1.3em;
     text-indent: 2ex;
+    color: $title_h2_color;
   }
 
   h3 {
     font-size: 1.1em;
     text-indent: 4ex;
+    color: $title_h3_color;
   }
 
   .pagenamerow {
@@ -136,6 +139,10 @@ ul {
   list-style-type: circle;
 }
 
+.homepagecat {
+  margin-top: 50px;
+}
+
 .headbadges {
   display: flex;
   align-items: center;

+ 10 - 4
static/css/style.css

@@ -64,13 +64,16 @@ body {
   padding: 2em 1em;
   height: 100%; }
   #content h1 {
-    font-size: 1.4em; }
+    font-size: 1.4em;
+    color: #ffc467; }
   #content h2 {
     font-size: 1.3em;
-    text-indent: 2ex; }
+    text-indent: 2ex;
+    color: #ffd89a; }
   #content h3 {
     font-size: 1.1em;
-    text-indent: 4ex; }
+    text-indent: 4ex;
+    color: #ffeccd; }
   #content .pagenamerow {
     display: flex;
     align-items: center;
@@ -81,7 +84,7 @@ body {
 
 #foot {
   font-size: 0.7em;
-  color: #989898;
+  color: #989797;
   display: flex;
   justify-content: flex-end;
   align-items: center;
@@ -97,6 +100,9 @@ a, a:visited {
 ul {
   list-style-type: circle; }
 
+.homepagecat {
+  margin-top: 50px; }
+
 .headbadges {
   display: flex;
   align-items: center;