From 0605a97a4a8208350df3097fbb26aa240c51686f Mon Sep 17 00:00:00 2001 From: danix Date: Thu, 26 Jan 2023 19:38:50 +0100 Subject: [PATCH] added data/socials to manage social links inside templates. General cleanup of the code --- assets/sass/main.scss | 8 +++++++- data/socials.json | 24 ++++++++++++++++++++++++ layouts/index-baseof.html | 5 ++--- layouts/partials/funcs/favicon.html | 19 +++++++++++++------ layouts/partials/head.html | 8 ++++---- layouts/partials/home-social-links.html | 10 ++++++++++ 6 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 data/socials.json create mode 100644 layouts/partials/home-social-links.html diff --git a/assets/sass/main.scss b/assets/sass/main.scss index 3ea3c2d..84d9fce 100644 --- a/assets/sass/main.scss +++ b/assets/sass/main.scss @@ -1,3 +1,9 @@ body { - background-color: #303030;; + background-color: #dadada;; + header#masthead { + background-color: #656565; + } + footer#colophon { + background-color: #656565; + } } \ No newline at end of file diff --git a/data/socials.json b/data/socials.json new file mode 100644 index 0000000..576bcba --- /dev/null +++ b/data/socials.json @@ -0,0 +1,24 @@ +{ + "sites": [ + { + "name": "twitter", + "url": "https://twitter.com", + "user": "danixland" + }, + { + "name": "reddit", + "url": "https://reddit.com/u", + "user": "danixland" + }, + { + "name": "instagram", + "url": "https://www.instagram.com", + "user": "danixland" + }, + { + "name": "facebook", + "url": "https://www.facebook.com", + "user": "danixland" + } + ] +} diff --git a/layouts/index-baseof.html b/layouts/index-baseof.html index 3f38b14..6889e6f 100644 --- a/layouts/index-baseof.html +++ b/layouts/index-baseof.html @@ -11,9 +11,8 @@ {{- block "home-main" . }}{{- end }} - {{- partial "footer.html" . -}} diff --git a/layouts/partials/funcs/favicon.html b/layouts/partials/funcs/favicon.html index 19bc0c3..ede85b0 100644 --- a/layouts/partials/funcs/favicon.html +++ b/layouts/partials/funcs/favicon.html @@ -1,7 +1,14 @@ - - - - + + + + - - +{{ range $i := .Site.Params.faviconSizes }} + {{ $favicon := resources.Get "img/icon.png" }} + {{ $image := $favicon.Resize (printf "%dx%d CatmullRom" $i $i) }} + +{{ end }} +{{ with resources.Get "img/icon.png" }} + {{ $image := .Resize "180x CatmullRom" }} + +{{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 477d463..4c451a9 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -3,12 +3,12 @@ - {{ $main_style := resources.Get "sass/main.scss" | resources.toCSS }} - + {{ $style_options := (dict "targetPath" "css/style.css" "outputStyle" "compressed" "transpiler" "dartsass" "enableSourceMap" (not hugo.IsProduction)) }} + {{ $style := resources.Get "sass/main.scss" | resources.ToCSS $style_options }} - + + {{ partial "funcs/favicon.html" . }} diff --git a/layouts/partials/home-social-links.html b/layouts/partials/home-social-links.html new file mode 100644 index 0000000..cef1f3a --- /dev/null +++ b/layouts/partials/home-social-links.html @@ -0,0 +1,10 @@ + -- 2.20.1