summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-04-21 17:35:15 +0200
committerVolpeon <git@volpeon.ink>2021-04-21 17:35:15 +0200
commit8941bbf9137d55912ba830fdc535949350449200 (patch)
tree2db0e41a91adbb52ec03006a84fdecb6d075020c
parentBetter project previews (diff)
downloadvolpeon.ink-8941bbf9137d55912ba830fdc535949350449200.tar.gz
volpeon.ink-8941bbf9137d55912ba830fdc535949350449200.tar.bz2
volpeon.ink-8941bbf9137d55912ba830fdc535949350449200.zip
Show category icon in project previews
-rw-r--r--assets/css/components/_project.scss3
-rw-r--r--metadata/metadata.yaml7
-rw-r--r--scripts/metadata_filter.lua7
-rw-r--r--templates/layouts/index.html5
-rw-r--r--templates/symbols.svg9
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 @@
23 23
24 &:link, 24 &:link,
25 &:visited { 25 &:visited {
26 color: currentColor;
27 text-decoration: none;
28
26 &:hover { 29 &:hover {
27 @include element('picture') { 30 @include element('picture') {
28 opacity: .75; 31 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:
22 22
23categories: 23categories:
24 personal: 24 personal:
25 dre: Dreams 25 dre:
26 name: Dreams
26 projects: 27 projects:
27 emj: Emojis 28 emj:
29 name: Emojis
30 icon: smile
28 31
29rewrites: 32rewrites:
30 path: 33 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
155function resolve_category(categories, category) 155function resolve_category(categories, category)
156 if categories and category then 156 if categories and category then
157 category = pandoc.utils.stringify(category) 157 category = pandoc.utils.stringify(category)
158 return pandoc.MetaMap({ 158 data = pandoc.MetaMap(categories[category])
159 id = pandoc.MetaString(category), 159 data.id = pandoc.MetaString(category)
160 name = pandoc.MetaString(categories[category] or category) 160 return data
161 })
162 end 161 end
163end 162end
164 163
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$
71 <img class="c-project__picture" src="$it.preview.rel$" /> 71 <img class="c-project__picture" src="$it.preview.rel$" />
72 $endif$ 72 $endif$
73 <div class="c-project__card c-card"> 73 <div class="c-project__card c-card">
74 $if(it.category.icon)$
75 <svg class="c-card__icon o-icon">
76 <use href="#icon-$it.category.icon$"></use>
77 </svg>
78 $endif$
74 <div class="c-card__content"> 79 <div class="c-card__content">
75 <small class="u-db">$it.category.name$</small> 80 <small class="u-db">$it.category.name$</small>
76 <strong class="u-db">$it.title$</strong> 81 <strong class="u-db">$it.title$</strong>
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 @@
60 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" 60 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"
61 fill="none" stroke="currentColor" /> 61 fill="none" stroke="currentColor" />
62 </symbol> 62 </symbol>
63
64 <symbol id="icon-smile" viewBox="0 0 16 16" preserveAspectRatio="xMinYMid">
65 <path d="m11.309 9.7658c-0.63143 1.1808-1.8764 1.9842-3.3091 1.9842-1.4381 0-2.6872-0.80955-3.3163-1.9978"
66 fill="none" stroke="currentColor" />
67 <circle cx="8" cy="8" r="6.75" fill="none" stroke="currentColor" />
68 <path d="m10.25 5.75v1.5" fill="none" stroke="currentColor" />
69 <path d="m5.75 5.75v1.5" fill="none" stroke="currentColor" />
70 </symbol>
71
63 </defs> 72 </defs>
64</svg> 73</svg>