diff options
author | Volpeon <git@volpeon.ink> | 2021-12-16 12:19:50 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2021-12-16 12:19:50 +0100 |
commit | 4a13dd4156d6468cbfd5139cdf12410bc9c3b07d (patch) | |
tree | f92dc286a25aac2f833b8feb8ac27e502af0cf29 | |
parent | Added RSS feeds (diff) | |
download | volpeon.ink-4a13dd4156d6468cbfd5139cdf12410bc9c3b07d.tar.gz volpeon.ink-4a13dd4156d6468cbfd5139cdf12410bc9c3b07d.tar.bz2 volpeon.ink-4a13dd4156d6468cbfd5139cdf12410bc9c3b07d.zip |
Support generic list layouts
-rw-r--r-- | content/profiles/index.md | 2 | ||||
-rw-r--r-- | content/projects/drawings/index.md | 1 | ||||
-rw-r--r-- | content/projects/emojis/index.md | 1 | ||||
-rw-r--r-- | content/projects/index.md | 8 | ||||
-rw-r--r-- | scripts/metadata_filter.lua | 5 | ||||
-rw-r--r-- | templates/layouts/categorized_list.html | 2 | ||||
-rw-r--r-- | templates/layouts/list.html | 2 |
7 files changed, 12 insertions, 9 deletions
diff --git a/content/profiles/index.md b/content/profiles/index.md index 0d8df9f..3007c62 100644 --- a/content/profiles/index.md +++ b/content/profiles/index.md | |||
@@ -1,6 +1,6 @@ | |||
1 | --- | 1 | --- |
2 | title: Profiles | 2 | title: Profiles |
3 | position: 1 | 3 | position: 1 |
4 | list_grid: true | 4 | list_layout: grid |
5 | list_post_icon: arrow-up-right | 5 | list_post_icon: arrow-up-right |
6 | --- | 6 | --- |
diff --git a/content/projects/drawings/index.md b/content/projects/drawings/index.md index d87fc73..643a6ad 100644 --- a/content/projects/drawings/index.md +++ b/content/projects/drawings/index.md | |||
@@ -1,6 +1,7 @@ | |||
1 | --- | 1 | --- |
2 | title: Drawings | 2 | title: Drawings |
3 | icon: image | 3 | icon: image |
4 | list_layout: grid | ||
4 | list_post_icon: arrow-right | 5 | list_post_icon: arrow-right |
5 | list_order: date_desc | 6 | list_order: date_desc |
6 | feed: true | 7 | feed: true |
diff --git a/content/projects/emojis/index.md b/content/projects/emojis/index.md index f2aec09..6ef4559 100644 --- a/content/projects/emojis/index.md +++ b/content/projects/emojis/index.md | |||
@@ -1,6 +1,7 @@ | |||
1 | --- | 1 | --- |
2 | title: Emojis | 2 | title: Emojis |
3 | icon: smile | 3 | icon: smile |
4 | list_layout: grid | ||
4 | list_post_icon: arrow-right | 5 | list_post_icon: arrow-right |
5 | list_order: date_desc | 6 | list_order: date_desc |
6 | feed: true | 7 | feed: true |
diff --git a/content/projects/index.md b/content/projects/index.md index 88e5a69..748126d 100644 --- a/content/projects/index.md +++ b/content/projects/index.md | |||
@@ -1,8 +1,8 @@ | |||
1 | --- | 1 | --- |
2 | title: Projects | 2 | title: Projects |
3 | position: 2 | 3 | position: 2 |
4 | list_grid: true | 4 | list_layout: grid |
5 | feed: true | 5 | feed: true |
6 | --- | 6 | --- |
7 | 7 | ||
8 | A selection of projects I wasn't too lazy to create a page for. | 8 | A selection of projects I wasn't too lazy to create a page for. |
diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua index d5a2909..a3675d9 100644 --- a/scripts/metadata_filter.lua +++ b/scripts/metadata_filter.lua | |||
@@ -215,7 +215,7 @@ function generate_list(meta) | |||
215 | description = (cat.description and pandoc.MetaBlocks(pandoc.Para(cat.description))) or | 215 | description = (cat.description and pandoc.MetaBlocks(pandoc.Para(cat.description))) or |
216 | (not cat.no_description and cat.content), | 216 | (not cat.no_description and cat.content), |
217 | url = cat.url, | 217 | url = cat.url, |
218 | grid = cat.list_grid, | 218 | layout = cat.list_layout, |
219 | items = items, | 219 | items = items, |
220 | total = tostring(#allItems), | 220 | total = tostring(#allItems), |
221 | omitted = omitted ~= 0 and tostring(omitted), | 221 | omitted = omitted ~= 0 and tostring(omitted), |
@@ -259,7 +259,7 @@ function generate_list(meta) | |||
259 | description = (cat.description and pandoc.MetaBlocks(pandoc.Para(cat.description))) or | 259 | description = (cat.description and pandoc.MetaBlocks(pandoc.Para(cat.description))) or |
260 | (not cat.no_description and cat.content), | 260 | (not cat.no_description and cat.content), |
261 | url = cat.url, | 261 | url = cat.url, |
262 | grid = cat.list_grid, | 262 | layout = cat.list_layout, |
263 | items = items, | 263 | items = items, |
264 | total = tostring(#allItems), | 264 | total = tostring(#allItems), |
265 | omitted = omitted ~= 0 and tostring(omitted), | 265 | omitted = omitted ~= 0 and tostring(omitted), |
@@ -276,6 +276,7 @@ function process(global, meta) | |||
276 | meta.url = resolve_url(global.site.url, global.file_out, meta.url or meta.file_out) | 276 | meta.url = resolve_url(global.site.url, global.file_out, meta.url or meta.file_out) |
277 | meta.title = (meta.title and pandoc.utils.stringify(meta.title)) or "" | 277 | meta.title = (meta.title and pandoc.utils.stringify(meta.title)) or "" |
278 | if meta.list_order then meta.list_order = pandoc.utils.stringify(meta.list_order) end | 278 | if meta.list_order then meta.list_order = pandoc.utils.stringify(meta.list_order) end |
279 | meta.list_layout = meta.list_layout and prep_layout(meta.list_layout) | ||
279 | if meta.position then meta.position = pandoc.utils.stringify(meta.position) end | 280 | if meta.position then meta.position = pandoc.utils.stringify(meta.position) end |
280 | 281 | ||
281 | if meta.feed then | 282 | if meta.feed then |
diff --git a/templates/layouts/categorized_list.html b/templates/layouts/categorized_list.html index 7d53cbe..73e75f3 100644 --- a/templates/layouts/categorized_list.html +++ b/templates/layouts/categorized_list.html | |||
@@ -13,7 +13,7 @@ $body$ | |||
13 | $if(it.description)$ | 13 | $if(it.description)$ |
14 | <div class="s-small s-colored-links">$it.description$</div> | 14 | <div class="s-small s-colored-links">$it.description$</div> |
15 | $endif$ | 15 | $endif$ |
16 | $if(it.grid)$ | 16 | $if(it.layout.is_grid)$ |
17 | <div class="l-card-list__cards l-card-list__cards--grid"> | 17 | <div class="l-card-list__cards l-card-list__cards--grid"> |
18 | $it.items:partials/grid_card()$ | 18 | $it.items:partials/grid_card()$ |
19 | </div> | 19 | </div> |
diff --git a/templates/layouts/list.html b/templates/layouts/list.html index f3e5768..32aa35a 100644 --- a/templates/layouts/list.html +++ b/templates/layouts/list.html | |||
@@ -5,7 +5,7 @@ $body$ | |||
5 | </header> | 5 | </header> |
6 | 6 | ||
7 | <div class="l-card-list"> | 7 | <div class="l-card-list"> |
8 | $if(list_grid)$ | 8 | $if(list_layout.is_grid)$ |
9 | <div class="l-card-list__cards l-card-list__cards--grid"> | 9 | <div class="l-card-list__cards l-card-list__cards--grid"> |
10 | $list:partials/grid_card()$ | 10 | $list:partials/grid_card()$ |
11 | </div> | 11 | </div> |