From 2d7954c1d173877d2ece47019411cdd3d2dd4840 Mon Sep 17 00:00:00 2001 From: Vri Date: Thu, 12 Jan 2023 23:07:45 +0100 Subject: [PATCH 1/2] Add icons helper --- assets/shortcodes/_icons.scss | 5 +++++ assets/shortcodes/_index.scss | 3 ++- layouts/partials/helpers/icons.html | 9 +++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 assets/shortcodes/_icons.scss create mode 100644 layouts/partials/helpers/icons.html diff --git a/assets/shortcodes/_icons.scss b/assets/shortcodes/_icons.scss new file mode 100644 index 0000000..b8ecb8a --- /dev/null +++ b/assets/shortcodes/_icons.scss @@ -0,0 +1,5 @@ +.icon { + width: 2rem; + height: 2rem; + fill: currentColor; +} \ No newline at end of file diff --git a/assets/shortcodes/_index.scss b/assets/shortcodes/_index.scss index be86844..00b695f 100644 --- a/assets/shortcodes/_index.scss +++ b/assets/shortcodes/_index.scss @@ -1 +1,2 @@ -@import "verticalposts"; \ No newline at end of file +@import "verticalposts"; +@import "icons"; \ No newline at end of file diff --git a/layouts/partials/helpers/icons.html b/layouts/partials/helpers/icons.html new file mode 100644 index 0000000..b9e2db2 --- /dev/null +++ b/layouts/partials/helpers/icons.html @@ -0,0 +1,9 @@ +{{ $svg := . }} +{{ $class := print $svg "-icon" }} +{{ $match := "(.*)" }} + +{{ $replaceWith := printf `${2}` $class }} +{{ return (replaceRE $match $replaceWith (printf "/assets/icons/%s.svg" $svg | readFile) | safeHTML) }} + +{{/* Taken from https://bitbanged.com/posts/how-to-use-inline-svgs-with-hugo/ */}} +{{/* Only works if SVG is on one line! */}} \ No newline at end of file From 9d5664fc844b125ace85651d1c362c561ec6be81 Mon Sep 17 00:00:00 2001 From: Vri Date: Thu, 12 Jan 2023 23:08:47 +0100 Subject: [PATCH 2/2] Add mastodon link --- assets/icons/mastodon.svg | 1 + assets/sidebar.scss | 9 +++++++++ layouts/partials/sidebar.html | 8 +++++--- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 assets/icons/mastodon.svg diff --git a/assets/icons/mastodon.svg b/assets/icons/mastodon.svg new file mode 100644 index 0000000..ca16949 --- /dev/null +++ b/assets/icons/mastodon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/sidebar.scss b/assets/sidebar.scss index fc3dfb9..6a0a1ea 100644 --- a/assets/sidebar.scss +++ b/assets/sidebar.scss @@ -34,6 +34,15 @@ #information { margin: 0; font-size: .8em; + #social-links { + list-style: none; + margin: 0; + padding: 0; + img { + height: 2em; + fill: var(--vriish-rose); + } + } } } #sidebar-menu { diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 3861f5f..29064b5 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -4,9 +4,11 @@

{{ .Site.Params.displayName }}

-

- {{ .Site.Params.username }} -

+