summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assets/css/components/_card.scss2
-rw-r--r--content/art/index.md13
-rw-r--r--content/notebook/index.md11
-rw-r--r--scripts/metadata_filter.lua19
4 files changed, 30 insertions, 15 deletions
diff --git a/assets/css/components/_card.scss b/assets/css/components/_card.scss
index d317d1f..ab399d8 100644
--- a/assets/css/components/_card.scss
+++ b/assets/css/components/_card.scss
@@ -134,7 +134,7 @@
134 position: relative; 134 position: relative;
135 width: 100%; 135 width: 100%;
136 height: 2em; 136 height: 2em;
137 padding-top: 50%; 137 padding-top: 46%;
138 } 138 }
139 139
140 @include iro.bem-elem('thumbnail-img') { 140 @include iro.bem-elem('thumbnail-img') {
diff --git a/content/art/index.md b/content/art/index.md
index 63032a3..9699145 100644
--- a/content/art/index.md
+++ b/content/art/index.md
@@ -1,8 +1,9 @@
1--- 1---
2title: Art 2title: Art
3position: 2 3position: 2
4list_layout: gallery-3 4list_layout: gallery-3
5list_order: date_desc 5list_order: date_desc
6list_limit: 6 6list_flatten: true
7feed: true 7list_limit: 6
8feed: true
8--- 9---
diff --git a/content/notebook/index.md b/content/notebook/index.md
index 77fed0b..b987880 100644
--- a/content/notebook/index.md
+++ b/content/notebook/index.md
@@ -1,9 +1,10 @@
1--- 1---
2title: Notebook 2title: Notebook
3position: 3 3position: 3
4list_limit: 4 4list_limit: 4
5list_order: date_desc 5list_order: date_desc
6feed: true 6list_flatten: true
7feed: true
7--- 8---
8 9
9Random thoughts, ordered and unordered. 10Random thoughts, ordered and unordered.
diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua
index cb060fa..07f060c 100644
--- a/scripts/metadata_filter.lua
+++ b/scripts/metadata_filter.lua
@@ -27,6 +27,19 @@ function pandoc.List:take(n)
27 return result 27 return result
28end 28end
29 29
30function dump(o)
31 if type(o) == 'table' then
32 local s = '{ '
33 for k, v in pairs(o) do
34 if type(k) ~= 'number' then k = '"' .. k .. '"' end
35 s = s .. '[' .. k .. '] = ' .. dump(v) .. ','
36 end
37 return s .. '} '
38 else
39 return tostring(o)
40 end
41end
42
30function page_sort(order) 43function page_sort(order)
31 return function(p1, p2) 44 return function(p1, p2)
32 if p1.position then 45 if p1.position then
@@ -241,10 +254,10 @@ function generate_list(meta)
241 return meta.pages.all 254 return meta.pages.all
242 :map(function(cat) 255 :map(function(cat)
243 local allItems = (cat.pages and cat.pages.all or pandoc.List()):flatMap(function(c) 256 local allItems = (cat.pages and cat.pages.all or pandoc.List()):flatMap(function(c)
244 if c.pages then 257 if not c.pages or not cat.list_flatten then
245 return c.pages.all:map(function(p) return d2_page_to_list_item(cat, c, p, true) end)
246 else
247 return pandoc.List({ d1_page_to_list_item(cat, c) }) 258 return pandoc.List({ d1_page_to_list_item(cat, c) })
259 else
260 return c.pages.all:map(function(p) return d2_page_to_list_item(cat, c, p, true) end)
248 end 261 end
249 end) 262 end)
250 allItems:sort(page_sort(cat.list_order)) 263 allItems:sort(page_sort(cat.list_order))