From e15f1076b59e997108914f6a5b9b28652d323268 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Sat, 20 Dec 2025 21:36:45 +0800 Subject: Change website structure to a log. --- projects.html | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 projects.html (limited to 'projects.html') diff --git a/projects.html b/projects.html new file mode 100644 index 0000000..5ebc056 --- /dev/null +++ b/projects.html @@ -0,0 +1,42 @@ +--- +layout: default +title: Projects +--- + +
+

{{ page.title }}

+ + {% assign n = 2 %} + {% assign projects = site.log | where: "project", true | sort: 'date' | reverse %} + {% assign rows = projects.size | divided_by: n %} + + {% assign remainder = projects.size | modulo: n %} + {% if remainder != 0 %} + {% assign rows = rows | plus: 1 %} + {% endif %} + + {% for i in (1..rows) %} + + {% assign offset = forloop.index0 | times: n %} + {% for item in projects limit:n offset:offset %} + + {% endfor %} + + {%- comment -%}Fill empty cells if this is the last row and has odd number of items{%- endcomment -%} + {% if forloop.last %} + {% assign items_in_last_row = projects.size | minus: offset %} + {% assign empty_cells = n | minus: items_in_last_row %} + {% for j in (1..empty_cells) %} + + {% endfor %} + {% endif %} + + {% endfor %} +
+ {% assign parts = item.url | split: '/' %} + + {{ item.title }} +
{{ item.title }}
+
+
+
-- cgit v1.2.3