From 50cea8caaa0e23e7a03209ba76b5138d4597460d Mon Sep 17 00:00:00 2001 From: danix Date: Tue, 7 Feb 2023 20:04:19 +0100 Subject: [PATCH] working on social icons presentation. Still needs some heavy lifting. --- TODO.md | 1 + assets/sass/main.scss | 12 +++++++++--- layouts/articles/list-baseof.html | 2 +- layouts/partials/funcs/svg.html | 4 ++++ layouts/partials/head-addition.html | 22 ++++++++++++---------- layouts/partials/header.html | 2 +- layouts/partials/home-social-links.html | 3 ++- layouts/shortcodes/svg.html | 4 ++++ 8 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 layouts/partials/funcs/svg.html create mode 100644 layouts/shortcodes/svg.html diff --git a/TODO.md b/TODO.md index 63524cd..a729d2e 100644 --- a/TODO.md +++ b/TODO.md @@ -13,6 +13,7 @@ THEME - fontawesome is too big for our use case. we could use just some SVG's and inspect other implementations, like shortcodes or partials to display them. + [interesting approach using SVG's](https://www.client9.com/using-font-awesome-icons-in-hugo/) + [using js and a shortcode](https://matze.rocks/posts/fontawesome_in_hugo/) + + [using partials and svgs](https://codingnconcepts.com/hugo/social-icons-hugo/) - content presentation before styling + we should finalize templates for different kinds of content before working on styling * homepage diff --git a/assets/sass/main.scss b/assets/sass/main.scss index 7017ef0..1f57f38 100644 --- a/assets/sass/main.scss +++ b/assets/sass/main.scss @@ -2,11 +2,10 @@ // BOURBON @import "bourbon/bourbon"; -// FONT-AWESOME v6.2.1 -@import "fa-v6/fontawesome"; -@import "fa-v6/brands"; + // MY COLOR DEFINITIONS @import "colors"; + // GOOGLE FONTS @import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,200;0,400;0,600;1,400;1,600&family=Red+Hat+Mono&display=swap'); @@ -119,4 +118,11 @@ div#backtotop { color: inherit; } } +} +.inline-svg { + display: inline-block; + height: 1.15rem; + width: 1.15rem; + top: 0.15rem; + position: relative; } \ No newline at end of file diff --git a/layouts/articles/list-baseof.html b/layouts/articles/list-baseof.html index 9a5985d..06d57b2 100644 --- a/layouts/articles/list-baseof.html +++ b/layouts/articles/list-baseof.html @@ -2,7 +2,7 @@ {{- partial "head.html" . -}} -
+
{{- partial "header.html" . -}} {{- partial "breadcrumbs.html" . -}} diff --git a/layouts/partials/funcs/svg.html b/layouts/partials/funcs/svg.html new file mode 100644 index 0000000..44e167b --- /dev/null +++ b/layouts/partials/funcs/svg.html @@ -0,0 +1,4 @@ + +{{ $svg := .Get 0 }} +{{ readFile ( print "SVGs/" . ".svg" ) | safeHTML }} + diff --git a/layouts/partials/head-addition.html b/layouts/partials/head-addition.html index fdfaef9..d975c51 100644 --- a/layouts/partials/head-addition.html +++ b/layouts/partials/head-addition.html @@ -1,14 +1,16 @@ {{/* * Add the featured image to the header if it's present in the Front Matter */}} -{{ if isset .Params "featured_image" }} - +{{ if .IsPage }} + {{ if isset .Params "featured_image" }} + + {{ end }} {{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 12ad245..555e229 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -6,6 +6,6 @@

{{ .Site.Params.Description }}

{{ if isset .Site.Menus "main" }} - {{- partial "main-menu.html" . -}} + {{- partial "main-menu.html" . -}} {{ end }} diff --git a/layouts/partials/home-social-links.html b/layouts/partials/home-social-links.html index 187053c..c118a29 100644 --- a/layouts/partials/home-social-links.html +++ b/layouts/partials/home-social-links.html @@ -3,8 +3,9 @@
diff --git a/layouts/shortcodes/svg.html b/layouts/shortcodes/svg.html new file mode 100644 index 0000000..64ee2b4 --- /dev/null +++ b/layouts/shortcodes/svg.html @@ -0,0 +1,4 @@ + +{{- $fname:=print "../SVGs/" ( .Get 0 ) ".svg" -}} +{{ $fname | readFile | safeHTML }} + \ No newline at end of file -- 2.20.1