diff options
author | Volpeon <git@volpeon.ink> | 2021-11-17 18:49:27 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2021-11-17 18:49:27 +0100 |
commit | cc02f7e0b99bf4b4c5139a3ae83840bf833a0c6d (patch) | |
tree | eaca86b2a487170ab66493526157dcc1aff4027e | |
parent | Re-add stylesheet hash (diff) | |
download | volpeon.ink-cc02f7e0b99bf4b4c5139a3ae83840bf833a0c6d.tar.gz volpeon.ink-cc02f7e0b99bf4b4c5139a3ae83840bf833a0c6d.tar.bz2 volpeon.ink-cc02f7e0b99bf4b4c5139a3ae83840bf833a0c6d.zip |
Better list limit
-rw-r--r-- | content/index.md | 3 | ||||
-rw-r--r-- | content/projects/index.md | 7 | ||||
-rw-r--r-- | scripts/metadata_filter.lua | 4 | ||||
-rw-r--r-- | templates/layouts/categorized_list.html | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/content/index.md b/content/index.md index f6e7893..75efead 100644 --- a/content/index.md +++ b/content/index.md | |||
@@ -1,6 +1,5 @@ | |||
1 | --- | 1 | --- |
2 | title: Volpeon's Den | 2 | title: Volpeon's Den |
3 | list_limit: 4 | ||
4 | --- | 3 | --- |
5 | 4 | ||
6 | Hi, I'm Volpeon! I'm a software developer who creates vector art. | 5 | Hi, I'm Volpeon! I'm a software developer who creates vector art. |
diff --git a/content/projects/index.md b/content/projects/index.md index 546ae46..3b6b718 100644 --- a/content/projects/index.md +++ b/content/projects/index.md | |||
@@ -1,5 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | title: Projects | 2 | title: Projects |
3 | position: 2 | 3 | position: 2 |
4 | list_grid: true | 4 | list_grid: true |
5 | list_limit: 4 | ||
5 | --- | 6 | --- |
diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua index 5fa7dfc..c154708 100644 --- a/scripts/metadata_filter.lua +++ b/scripts/metadata_filter.lua | |||
@@ -196,8 +196,6 @@ end | |||
196 | function generate_list(meta) | 196 | function generate_list(meta) |
197 | if not meta.pages then return nil end | 197 | if not meta.pages then return nil end |
198 | 198 | ||
199 | local limit = (meta.list_limit and tonumber(pandoc.utils.stringify(meta.list_limit))) or 9999 | ||
200 | |||
201 | if meta.depth == "1" then | 199 | if meta.depth == "1" then |
202 | return meta.pages.all:map(function(p) | 200 | return meta.pages.all:map(function(p) |
203 | return { | 201 | return { |
@@ -212,6 +210,7 @@ function generate_list(meta) | |||
212 | end) | 210 | end) |
213 | elseif meta.depth == "2" then | 211 | elseif meta.depth == "2" then |
214 | return meta.pages.all:map(function(cat) | 212 | return meta.pages.all:map(function(cat) |
213 | local limit = (cat.list_limit and tonumber(pandoc.utils.stringify(cat.list_limit))) or 9999 | ||
215 | local allItems = ((cat.pages and cat.pages.all) or pandoc.List()):map(function(p) | 214 | local allItems = ((cat.pages and cat.pages.all) or pandoc.List()):map(function(p) |
216 | return { | 215 | return { |
217 | title = p.title, | 216 | title = p.title, |
@@ -238,6 +237,7 @@ function generate_list(meta) | |||
238 | end):filter(function(cat) return #cat.items ~= 0 end) | 237 | end):filter(function(cat) return #cat.items ~= 0 end) |
239 | elseif meta.depth == "3" then | 238 | elseif meta.depth == "3" then |
240 | return meta.pages.all:map(function(cat) | 239 | return meta.pages.all:map(function(cat) |
240 | local limit = (cat.list_limit and tonumber(pandoc.utils.stringify(cat.list_limit))) or 9999 | ||
241 | local allItems = (cat.pages and cat.pages.all or pandoc.List()):flatMap(function(c) | 241 | local allItems = (cat.pages and cat.pages.all or pandoc.List()):flatMap(function(c) |
242 | if c.pages then | 242 | if c.pages then |
243 | return c.pages.all:map(function(p) | 243 | return c.pages.all:map(function(p) |
diff --git a/templates/layouts/categorized_list.html b/templates/layouts/categorized_list.html index c5a76b2..0508230 100644 --- a/templates/layouts/categorized_list.html +++ b/templates/layouts/categorized_list.html | |||
@@ -10,7 +10,7 @@ $body$ | |||
10 | <header class="c-card-list__category-header"> | 10 | <header class="c-card-list__category-header"> |
11 | <div> | 11 | <div> |
12 | <h2 class="c-card-list__category-title"> | 12 | <h2 class="c-card-list__category-title"> |
13 | <a href="$it.url.rel$">$it.title$ →</a> | 13 | <a href="$it.url.rel$">$it.title$</a> |
14 | </h2> | 14 | </h2> |
15 | $if(it.omitted)$<small>$it.omitted$ more</small>$endif$ | 15 | $if(it.omitted)$<small>$it.omitted$ more</small>$endif$ |
16 | </div> | 16 | </div> |