Browse Source

:tada: First try to list projects

Iteration at the template level is working.

Tuning is still required.
DricomDragon 1 year ago
parent
commit
b16c075a67
3 changed files with 21 additions and 16 deletions
  1. 16 0
      src/templates/card.html
  2. 5 0
      src/templates/main.html
  3. 0 16
      src/templates/project-card.html

+ 16 - 0
src/templates/card.html

@@ -0,0 +1,16 @@
+<!-- Project card component -->
+<div class="card">
+    <img class="card-img-top" src="$it.title-img.path$"$if(it.title-img.alt)$ alt="$it.title-img.alt$"$endif$>
+    <div class="card-body">
+        <h4 class="card-title">
+            <img src="$it.title-img.path$"$if(it.title-img.alt)$ alt="$it.title-img.alt$"$endif$>
+            $it.title$
+        </h4>
+        <p class="card-text">
+            $it.content-description$
+        </p>
+        <a href="todo" class="btn btn-success btn-block">
+            Page du projet
+        </a>
+    </div>
+</div>

+ 5 - 0
src/templates/main.html

@@ -98,6 +98,11 @@ $if(toc)$
             </nav>
 $endif$
             $^$$body$
+$if(list)$
+            <div class="card-columns">
+                    $^$${ list:card() }
+            </div>
+$endif$
         </main>
 $for(include-after)$
         $^$$include-after$

+ 0 - 16
src/templates/project-card.html

@@ -1,16 +0,0 @@
-<!-- Project card component -->
-<div class="card">
-    <img class="card-img-top" src="<?php echo $pro_img_src; ?>" alt="<?php echo $pro_image_alt; ?>">
-    <div class="card-body">
-        <h4 class="card-title">
-            <img src="<?php echo $category_img_src; ?>" alt="<?php echo $category_img_alt; ?>">
-            <?php echo $pro_title; ?>
-        </h4>
-        <p class="card-text">
-        <?php echo $pro_text; ?>
-        </p>
-        <a href="<?php echo $pro_page; ?>" class="btn btn-success btn-block">
-            Page du projet
-        </a>
-    </div>
-</div>