From 1f13ab438034be68dc68e874495aeb1e68af1b9c Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Mon, 17 Apr 2023 20:27:08 +0200
Subject: [PATCH] Add the publications' page

---
 compiler.py         |  1 +
 data/global.yaml    |  1 +
 templates/pubs.html | 38 ++++++++++++++++----------------------
 3 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/compiler.py b/compiler.py
index b33cac8..ea06753 100644
--- a/compiler.py
+++ b/compiler.py
@@ -147,6 +147,7 @@ if __name__ == "__main__":
     PAGES = [
         "index.html",
         "gallery.html",
+        "pubs.html",
         "about.html",
         "contact.html"
     ]
diff --git a/data/global.yaml b/data/global.yaml
index 9f19a71..4356ff7 100644
--- a/data/global.yaml
+++ b/data/global.yaml
@@ -7,5 +7,6 @@ navbar: [
   # Give in [Display_Name, Template_Name format].
   [About, "about.html"],
   [Gallery, "gallery.html"],
+  [Publications, "pubs.html"],
   [Contact, "contact.html"]
 ]
diff --git a/templates/pubs.html b/templates/pubs.html
index db8c9bf..8a1c842 100644
--- a/templates/pubs.html
+++ b/templates/pubs.html
@@ -7,27 +7,21 @@
 {% block content %}
     {{ helper.wide_header() }}
     <div class="container">
-        {{ helper.navbar(navbar, link) }}
-        <div class="cards">
-            {% for card in cards|sort_cards %}
-                <div class="card">
-                    <a class="card-content" href="{{ card.link }}">
-                        {% if card.img %}
-                            <div class="card-img">
-                                <img src="{{ card.img }}">
-                            </div>
-                        {% endif %}
-                        <div class="card-text">
-                          <h3>{{ card.title }}</h2>
-                          <b><h3>{{ card.journal }}</h3></b>
-                          <p>{{ card.date }}</p>
-                        </div>
-                    </a>
-                </div>
-            {% endfor %}
-            {% for i in range(3 - (cards|length % 3)) %} {# Add extra padding #}
-                <div class="card-pad"></div>
-            {% endfor %}
-        </div>
+      {{ helper.navbar(navbar, link) }}
+
+       <div class="text">
+         <h2>Publications using SWIFT</h2>
+       </div>
+      
+       {% for card in cards|sort_cards %}
+       <div class="card-text">
+         <h4>{{ loop.index }}) <a href="https://ui.adsabs.harvard.edu/abs/{{ card.bibcode }}/abstract">{{ card.title }}</h4></a>
+	 {% if card.author_count > 1 %}
+         <p>{{ card.first_author_norm }} et al., {{ card.year }}</p>
+	 {% else %}
+	 <p>{{ card.first_author_norm }}, {{ card.year }}</p>
+	 {% endif %}			  
+       </div>
+       {% endfor %}
     </div>
 {% endblock %}
-- 
GitLab