From 8941bbf9137d55912ba830fdc535949350449200 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 21 Apr 2021 17:35:15 +0200 Subject: Show category icon in project previews --- assets/css/components/_project.scss | 3 +++ metadata/metadata.yaml | 7 +++++-- scripts/metadata_filter.lua | 7 +++---- templates/layouts/index.html | 5 +++++ templates/symbols.svg | 9 +++++++++ 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/assets/css/components/_project.scss b/assets/css/components/_project.scss index 62a7118..4f4cd1b 100644 --- a/assets/css/components/_project.scss +++ b/assets/css/components/_project.scss @@ -23,6 +23,9 @@ &:link, &:visited { + color: currentColor; + text-decoration: none; + &:hover { @include element('picture') { opacity: .75; diff --git a/metadata/metadata.yaml b/metadata/metadata.yaml index 8716b43..226401d 100644 --- a/metadata/metadata.yaml +++ b/metadata/metadata.yaml @@ -22,9 +22,12 @@ feeds: categories: personal: - dre: Dreams + dre: + name: Dreams projects: - emj: Emojis + emj: + name: Emojis + icon: smile rewrites: path: diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua index ad2bb83..8eedc63 100644 --- a/scripts/metadata_filter.lua +++ b/scripts/metadata_filter.lua @@ -155,10 +155,9 @@ end function resolve_category(categories, category) if categories and category then category = pandoc.utils.stringify(category) - return pandoc.MetaMap({ - id = pandoc.MetaString(category), - name = pandoc.MetaString(categories[category] or category) - }) + data = pandoc.MetaMap(categories[category]) + data.id = pandoc.MetaString(category) + return data end end diff --git a/templates/layouts/index.html b/templates/layouts/index.html index c9c695a..1099d27 100644 --- a/templates/layouts/index.html +++ b/templates/layouts/index.html @@ -71,6 +71,11 @@ $body$ $endif$
+ $if(it.category.icon)$ + + + + $endif$
$it.category.name$ $it.title$ diff --git a/templates/symbols.svg b/templates/symbols.svg index e96fd50..acc7f4f 100644 --- a/templates/symbols.svg +++ b/templates/symbols.svg @@ -60,5 +60,14 @@ d="m12.25 5.75c0 3.5899-2.9101 6.5-6.5 6.5m3e-7 0c0 1.1046-0.89543 2-2 2s-2-0.89543-2-2 0.89543-2 2-2 2 0.89543 2 2zm8.5-8.5c0 1.1046-0.89543 2-2 2s-2-0.89543-2-2 0.89543-2 2-2 2 0.89543 2 2zm-10.5 6.4998v-7.9998" fill="none" stroke="currentColor" /> + + + + + + + + -- cgit v1.2.3-70-g09d2