From e3868a434d78a8355402431daaa6c2fa9e07e71a Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Fri, 11 Dec 2020 16:16:04 +0100 Subject: [PATCH] List recent articles --- content/_index.md | 2 ++ content/lorem.md | 2 ++ static/style.css | 2 ++ templates/index.html | 4 +++- templates/macros.html | 8 ++++++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/content/_index.md b/content/_index.md index b3f542f..96d1f14 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,3 +1,5 @@ +++ +sort_by = "date" +paginate_by = 4 +++ diff --git a/content/lorem.md b/content/lorem.md index d98dd02..9222d5c 100644 --- a/content/lorem.md +++ b/content/lorem.md @@ -12,6 +12,8 @@ tags = ["lorem", "ipsum"] Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Erat pellentesque adipiscing commodo elit at. Morbi blandit cursus risus at ultrices mi tempus imperdiet nulla. Quis viverra nibh cras pulvinar. Cursus in hac habitasse platea dictumst. Pulvinar etiam non quam lacus. Turpis egestas maecenas pharetra convallis posuere morbi leo urna molestie. Quam elementum pulvinar etiam non quam lacus suspendisse faucibus. In pellentesque massa placerat duis ultricies lacus. Sed vulputate odio ut enim blandit volutpat maecenas volutpat. Vitae congue mauris rhoncus aenean vel elit scelerisque mauris pellentesque. + + Dignissim enim sit amet venenatis urna cursus eget nunc. Cras adipiscing enim eu turpis egestas. Elementum pulvinar etiam non quam lacus suspendisse faucibus interdum posuere. Volutpat diam ut venenatis tellus in metus vulputate eu scelerisque. In tellus integer feugiat scelerisque. Tellus integer feugiat scelerisque varius. Nunc congue nisi vitae suscipit tellus mauris a diam. Faucibus interdum posuere lorem ipsum dolor sit amet consectetur adipiscing. Faucibus interdum posuere lorem ipsum dolor sit amet. Erat imperdiet sed euismod nisi porta lorem mollis. Diam ut venenatis tellus in. Erat nam at lectus urna duis convallis. Nibh sed pulvinar proin gravida hendrerit lectus. Quam id leo in vitae turpis massa sed. Luctus venenatis lectus magna fringilla urna porttitor rhoncus dolor. Donec et odio pellentesque diam volutpat. Ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget. Nec ullamcorper sit amet risus nullam eget felis. Sit amet dictum sit amet justo donec enim diam. Nulla pellentesque dignissim enim sit amet venenatis urna cursus eget. Sed odio morbi quis commodo odio aenean. Et netus et malesuada fames ac turpis egestas maecenas. Gravida quis blandit turpis cursus in hac habitasse. Nisl suscipit adipiscing bibendum est ultricies. Feugiat scelerisque varius morbi enim nunc faucibus a pellentesque. Urna cursus eget nunc scelerisque. diff --git a/static/style.css b/static/style.css index 50a3655..1a04196 100644 --- a/static/style.css +++ b/static/style.css @@ -62,6 +62,8 @@ main .info ul { } main .info ul li { margin-right: 1em } +main article h1 a { color: inherit } + a { color: #E1140A; text-decoration: none; diff --git a/templates/index.html b/templates/index.html index 2c9f2ae..97a50ac 100644 --- a/templates/index.html +++ b/templates/index.html @@ -25,7 +25,9 @@
{% block content %} - {{ section.content | safe }} + {% for page in paginator.pages %} + {{ macros::list_article(page=page) }} + {% endfor %} {% endblock content %}
diff --git a/templates/macros.html b/templates/macros.html index b65b7ef..c9f66b9 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -26,3 +26,11 @@ {% endif %} {% endmacro page_info %} + +{% macro list_article(page) %} +
+

{{ page.title }}

+

{{ page.summary | safe }}

+ {{ self::page_info(page=page) }} +
+{% endmacro list_articles %}