From 0e1d340bce7a22323bb00e6b8e7328bd79bf5a53 Mon Sep 17 00:00:00 2001
From: jultty <jutty@tuta.io>
Date: Sun, 17 Nov 2024 15:27:52 -0300
Subject: [PATCH] List all content types in homepage

---
 static/assets/css/style.css | 12 ++++++++++
 templates/index.html        | 48 +++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)

diff --git a/static/assets/css/style.css b/static/assets/css/style.css
index d0dfc912..8eb06b1a 100644
--- a/static/assets/css/style.css
+++ b/static/assets/css/style.css
@@ -272,6 +272,13 @@ footer {
     grid-template-columns: 13% 64% 10% 13%;
   }
 
+  .index-h2 {
+    font-size: 1em;
+    margin-left: 14%;
+    padding-left: 20px;
+    margin-top: 40px;
+  }
+
   .index-posts ul#posts {
     margin-left: 14%;
     padding-left: 20px;
@@ -282,6 +289,11 @@ footer {
     padding-left: 20px;
   }
 
+  .index-see-all {
+    margin-left: 14%;
+    padding-left: 20px;
+  }
+
   .article {
     margin: 0 45px;
   }
diff --git a/templates/index.html b/templates/index.html
index d0b43d03..109eb7b0 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -20,6 +20,7 @@
 
 {% block content %}
 
+  <h2 class="index-h2">Latest posts</h2>
   {%- if lang == "pt" %}
     {%- set posts = get_section(path="posts/_index.pt.md") %}
   {%- else %}
@@ -32,7 +33,54 @@
               <span class="post-date">{{ post.date }}</span>
               <a href="{{ post.permalink | safe }}">{{ post.title }}</a>
             </li>
+            {% if loop.index == 5  %}{% break %}{% endif %}
             {% endfor %}
           </ul>
         </nav>
+        <a class="index-see-all" href="{{ posts.permalink }}">
+          {%- if lang == "pt" %}Ver todos{% else %}See all{% endif %}
+        </a>
+
+  <h2 class="index-h2">Latest notes</h2>
+  {%- if lang == "pt" %}
+    {%- set notes = get_section(path="notes/_index.pt.md") %}
+  {%- else %}
+    {%- set notes = get_section(path="notes/_index.md") %}
+  {%- endif %}
+        <nav class="index-posts">
+          <ul id="posts">
+            {% for note in notes.pages %}
+            <li>
+              <span class="post-date">{{ note.date }}</span>
+              <a href="{{ note.permalink | safe }}">{{ note.title }}</a>
+            </li>
+            {% if loop.index == 5  %}{% break %}{% endif %}
+            {% endfor %}
+          </ul>
+        </nav>
+        <a class="index-see-all" href="{{ notes.permalink }}">
+          {%- if lang == "pt" %}Ver todos{% else %}See all{% endif %}
+        </a>
+
+  <h2 class="index-h2">Latest links</h2>
+  {%- if lang == "pt" %}
+    {%- set links = get_section(path="links/_index.pt.md") %}
+  {%- else %}
+    {%- set links = get_section(path="links/_index.md") %}
+  {%- endif %}
+        <nav class="index-posts">
+          <ul id="posts">
+            {% for link in links.pages %}
+            <li>
+              <span class="post-date">{{ link.date }}</span>
+              <a href="{{ link.permalink | safe }}">{{ link.title }}</a>
+            </li>
+            {% if loop.index == 5  %}{% break %}{% endif %}
+            {% endfor %}
+          </ul>
+        </nav>
+        <a class="index-see-all" href="{{ links.permalink }}">
+          {%- if lang == "pt" %}Ver todos{% else %}See all{% endif %}
+        </a>
+
 {%- endblock content %}