working on social icons presentation. Still needs some heavy lifting.
authordanix <danix@danix.xyz>
Tue, 7 Feb 2023 19:04:19 +0000 (20:04 +0100)
committerdanix <danix@danix.xyz>
Tue, 7 Feb 2023 19:04:19 +0000 (20:04 +0100)
TODO.md
assets/sass/main.scss
layouts/articles/list-baseof.html
layouts/partials/funcs/svg.html [new file with mode: 0644]
layouts/partials/head-addition.html
layouts/partials/header.html
layouts/partials/home-social-links.html
layouts/shortcodes/svg.html [new file with mode: 0644]

diff --git a/TODO.md b/TODO.md
index 63524cd..a729d2e 100644 (file)
--- 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
index 7017ef0..1f57f38 100644 (file)
@@ -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
index 9a5985d..06d57b2 100644 (file)
@@ -2,7 +2,7 @@
 <html lang="{{ $.Site.LanguageCode | default "en" }}">
        {{- partial "head.html" . -}}
        <body class="blog">
-               <div id="page">
+               <div id="page" class="section-blog">
                        <a id="top" class="skip-link screen-reader-text" href="#primary">skip to content</a>
                        {{- partial "header.html" . -}}
                        {{- partial "breadcrumbs.html" . -}}
diff --git a/layouts/partials/funcs/svg.html b/layouts/partials/funcs/svg.html
new file mode 100644 (file)
index 0000000..44e167b
--- /dev/null
@@ -0,0 +1,4 @@
+<span class="inline-svg">
+{{ $svg := .Get 0 }}
+{{ readFile ( print "SVGs/" . ".svg" ) | safeHTML  }}
+</span>
index fdfaef9..d975c51 100644 (file)
@@ -1,14 +1,16 @@
 {{/*
        * Add the featured image to the header if it's present in the Front Matter
        */}}
-{{ if isset .Params "featured_image" }}
-<style media="screen">
-       header#masthead {
-               height: 60vh;
-               background-image: url( {{ $.Params.featured_image | absURL }} );
-               background-repeat: no-repeat;
-               background-position: center center;
-               background-attachment: fixed;
-       }
-</style>
+{{ if .IsPage }}
+       {{ if isset .Params "featured_image" }}
+       <style media="screen">
+               header#masthead {
+                       height: 60vh;
+                       background-image: url( {{ $.Params.featured_image | absURL }} );
+                       background-repeat: no-repeat;
+                       background-position: center center;
+                       background-attachment: fixed;
+               }
+       </style>
+       {{ end }}
 {{ end }}
index 12ad245..555e229 100644 (file)
@@ -6,6 +6,6 @@
                <p class="site-description">{{ .Site.Params.Description }}</p>
        </div>
        {{ if isset .Site.Menus "main" }}
-       {{- partial "main-menu.html" . -}}
+               {{- partial "main-menu.html" . -}}
        {{ end }}
 </header>
index 187053c..c118a29 100644 (file)
@@ -3,8 +3,9 @@
        <ul class="social-links-list">
                {{ range site.Data.socials.sites | shuffle }}
                        <li>
-                               <a href="{{ .url }}/{{ .user }}"><i class="fa-brands fa-square-{{ .name }}"></i><span class="screen-reader-text">{{ .name }}</span></a>
+                               <a href="{{ .url }}/{{ .user }}">{{ partial "funcs/svg.html" ".name" }}</a>
                        </li>
                {{ end }}
+                       <li class="linux">{{ partial "funcs/svg.html" "linux" }}</li>
        </ul>
 </div>
diff --git a/layouts/shortcodes/svg.html b/layouts/shortcodes/svg.html
new file mode 100644 (file)
index 0000000..64ee2b4
--- /dev/null
@@ -0,0 +1,4 @@
+<span class="inline-svg" >
+{{- $fname:=print "../SVGs/" ( .Get 0 ) ".svg" -}}
+{{ $fname | readFile | safeHTML }}
+</span>
\ No newline at end of file