From f9a74f5ca7c1e919bba46d99d65a7b3a893a7bd7 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 14 Nov 2021 10:28:18 +0100 Subject: List improvements --- assets/css/components/_card-list.scss | 10 ++++++++++ content/profiles/bandcamp.md | 6 ++++++ content/profiles/bandcamp/index.md | 5 ----- content/profiles/bandcamp/main.md | 5 ----- content/profiles/email.md | 6 ++++++ content/profiles/email/index.md | 5 ----- content/profiles/email/main.md | 5 ----- content/profiles/fediverse.md | 6 ++++++ content/profiles/fediverse/index.md | 5 ----- content/profiles/fediverse/main.md | 5 ----- content/profiles/git.md | 6 ++++++ content/profiles/git/index.md | 5 ----- content/profiles/git/main.md | 5 ----- content/profiles/index.md | 7 ++++--- scripts/metadata_filter.lua | 13 +++++++------ templates/layouts/categorized_list.html | 11 ++++++++--- templates/partials/grid_card.html | 3 +++ templates/partials/list_card.html | 6 ++++++ 18 files changed, 62 insertions(+), 52 deletions(-) create mode 100644 content/profiles/bandcamp.md delete mode 100644 content/profiles/bandcamp/index.md delete mode 100644 content/profiles/bandcamp/main.md create mode 100644 content/profiles/email.md delete mode 100644 content/profiles/email/index.md delete mode 100644 content/profiles/email/main.md create mode 100644 content/profiles/fediverse.md delete mode 100644 content/profiles/fediverse/index.md delete mode 100644 content/profiles/fediverse/main.md create mode 100644 content/profiles/git.md delete mode 100644 content/profiles/git/index.md delete mode 100644 content/profiles/git/main.md diff --git a/assets/css/components/_card-list.scss b/assets/css/components/_card-list.scss index 2a2ae69..0f44b00 100644 --- a/assets/css/components/_card-list.scss +++ b/assets/css/components/_card-list.scss @@ -20,7 +20,9 @@ @include element('category-header') { margin-top: $line-height * 2rem; color: prop(--colors --cat --fg); + } + @include element('category-title') { :link, :visited { text-decoration: none; @@ -31,6 +33,14 @@ } } + @include element('category-subtitle') { + display: block; + + p { + margin-top: $line-height * .25rem; + } + } + @include element('category-content') { margin-top: $line-height * .5rem; filter: drop-shadow(#{prop(--dims --obj-shadow, $global: true)} #{prop(--colors --obj-shadow, $global: true)}); diff --git a/content/profiles/bandcamp.md b/content/profiles/bandcamp.md new file mode 100644 index 0000000..d3a5e2b --- /dev/null +++ b/content/profiles/bandcamp.md @@ -0,0 +1,6 @@ +--- +title: Bandcamp +subtitle: volpeon +icon: parallelogram +url: https://bandcamp.com/volpeon +--- diff --git a/content/profiles/bandcamp/index.md b/content/profiles/bandcamp/index.md deleted file mode 100644 index 0a47469..0000000 --- a/content/profiles/bandcamp/index.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Bandcamp -icon: parallelogram -list_post_icon: icon-arrow-up-right ---- diff --git a/content/profiles/bandcamp/main.md b/content/profiles/bandcamp/main.md deleted file mode 100644 index f94213f..0000000 --- a/content/profiles/bandcamp/main.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: volpeon -titlecase: false -url: https://bandcamp.com/volpeon ---- diff --git a/content/profiles/email.md b/content/profiles/email.md new file mode 100644 index 0000000..657d620 --- /dev/null +++ b/content/profiles/email.md @@ -0,0 +1,6 @@ +--- +title: E-Mail +subtitle: me@volpeon.ink +icon: envelope +url: mailto:me@volpeon.ink +--- diff --git a/content/profiles/email/index.md b/content/profiles/email/index.md deleted file mode 100644 index 6eef738..0000000 --- a/content/profiles/email/index.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: E-Mail -icon: envelope -list_post_icon: icon-arrow-up-right ---- diff --git a/content/profiles/email/main.md b/content/profiles/email/main.md deleted file mode 100644 index 16f103a..0000000 --- a/content/profiles/email/main.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: me@volpeon.ink -titlecase: false -url: "mailto:me@volpeon.ink" ---- diff --git a/content/profiles/fediverse.md b/content/profiles/fediverse.md new file mode 100644 index 0000000..d43b1fa --- /dev/null +++ b/content/profiles/fediverse.md @@ -0,0 +1,6 @@ +--- +title: Fediverse +subtitle: "@volpeon@mk.vulpes.one" +icon: graph +url: https://mk.vulpes.one/@volpeon +--- diff --git a/content/profiles/fediverse/index.md b/content/profiles/fediverse/index.md deleted file mode 100644 index 56eb848..0000000 --- a/content/profiles/fediverse/index.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fediverse -icon: graph -list_post_icon: icon-arrow-up-right ---- diff --git a/content/profiles/fediverse/main.md b/content/profiles/fediverse/main.md deleted file mode 100644 index 70ee902..0000000 --- a/content/profiles/fediverse/main.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "@volpeon@mk.vulpes.one" -titlecase: false -url: "https://mk.vulpes.one/@volpeon" ---- diff --git a/content/profiles/git.md b/content/profiles/git.md new file mode 100644 index 0000000..63b1bfc --- /dev/null +++ b/content/profiles/git.md @@ -0,0 +1,6 @@ +--- +title: Git +subtitle: git.vulpes.one +icon: git-branch +url: https://git.vulpes.one/ +--- diff --git a/content/profiles/git/index.md b/content/profiles/git/index.md deleted file mode 100644 index 0d747a6..0000000 --- a/content/profiles/git/index.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Git -icon: git-branch -list_post_icon: icon-arrow-up-right ---- diff --git a/content/profiles/git/main.md b/content/profiles/git/main.md deleted file mode 100644 index fb25680..0000000 --- a/content/profiles/git/main.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "git.vulpes.one" -titlecase: false -url: "https://git.vulpes.one/" ---- diff --git a/content/profiles/index.md b/content/profiles/index.md index 6514367..265a23b 100644 --- a/content/profiles/index.md +++ b/content/profiles/index.md @@ -1,5 +1,6 @@ --- -title: Profiles -position: 1 -list_grid: true +title: Profiles +position: 1 +list_grid: true +list_post_icon: icon-arrow-up-right --- diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua index b16d472..b6df703 100644 --- a/scripts/metadata_filter.lua +++ b/scripts/metadata_filter.lua @@ -200,7 +200,7 @@ function generate_list(meta) return meta.pages.all:map(function(cat) return { title = cat.title, - content = pandoc.utils.stringify(cat.content), + content = cat.content, url = cat.url, grid = cat.list_grid, items = cat.pages.all:map(function(p) @@ -220,7 +220,7 @@ function generate_list(meta) return meta.pages.all:map(function(cat) return { title = cat.title, - content = pandoc.utils.stringify(cat.content), + content = cat.content, url = cat.url, grid = cat.list_grid, items = cat.pages.all:flatMap(function(c) @@ -228,7 +228,8 @@ function generate_list(meta) return c.pages.all:map(function(p) return { title = p.title, - subtitle = p.subtitle or c.title, + subtitle = p.subtitle, + category = c.title, url = p.url, icon = p.icon or c.icon, post_icon = c.list_post_icon or cat.list_post_icon, @@ -241,9 +242,9 @@ function generate_list(meta) title = c.title, subtitle = c.subtitle, url = c.url, - icon = c.icon or meta.icon, - post_icon = meta.list_post_icon, - indicator = meta.list_read_indicators, + icon = c.icon or cat.icon, + post_icon = cat.list_post_icon, + indicator = cat.list_read_indicators, }) return l end diff --git a/templates/layouts/categorized_list.html b/templates/layouts/categorized_list.html index aea8863..256e9de 100644 --- a/templates/layouts/categorized_list.html +++ b/templates/layouts/categorized_list.html @@ -7,9 +7,14 @@ $body$
$for(list)$ -

- $it.title$ -

+
+

+ $it.title$ +

+ $if(it.content)$ + $it.content$ + $endif$ +
$if(it.grid)$
$it.items:partials/grid_card()$ diff --git a/templates/partials/grid_card.html b/templates/partials/grid_card.html index 25c2271..4b24711 100644 --- a/templates/partials/grid_card.html +++ b/templates/partials/grid_card.html @@ -9,7 +9,10 @@ $endif$
$if(it.subtitle)$ + $it.title$ $it.subtitle$ + $elseif(it.category)$ + $it.category$ $it.title$ $elseif(it.date)$
+ $elseif(it.category)$ +
+ + $it.category$ + +
$elseif(it.date)$