]> git.danielmrcl.dev Git - danielmrcl.dev.git/commitdiff
add favicon
authorDaniel Jr <dan@danielmrcl.dev>
Sat, 28 Sep 2024 20:25:52 +0000 (17:25 -0300)
committerDaniel Jr <dan@danielmrcl.dev>
Sat, 28 Sep 2024 20:25:52 +0000 (17:25 -0300)
Signed-off-by: Daniel Jr <dan@danielmrcl.dev>
hugo.toml
static/favicon.ico [new file with mode: 0644]
themes/cactus/layouts/partials/favicon.html

index dbf463b983a01c62a698d7312c3f4728c49f4638..a8b0d0635d824ac67a4e552430b76b5ea2a1e091 100644 (file)
--- a/hugo.toml
+++ b/hugo.toml
@@ -35,6 +35,7 @@ weight = 2
   rss = false
   tocInline = true
   logo = "image.jpg"
+  favicon = "favicon.ico"
   description = "Since 2021, I've been developing Java 8+ applications using Spring and PostgreSQL in a microservices architecture for critical, efficient and scalable systems. With a focus on code quality, architecture and scalability, I have strong foundation of programming, design and architecture. I am passionate about programming and constantly learn new technologies and paradigms."
   mainSection = "posts"
   postsOnHomePage = 5
diff --git a/static/favicon.ico b/static/favicon.ico
new file mode 100644 (file)
index 0000000..1e3783f
Binary files /dev/null and b/static/favicon.ico differ
index 5b4c0b3a808fad375142eb85c519a4c0cb7ea281..eb3745fffba561dacb6341e097fb5198f1d39c06 100644 (file)
@@ -1,2 +1,8 @@
-<!-- TODO -->
-<link rel="icon" type="image/png" href="{{ "images/favicon.ico"  | absURL }}" />
+{{ if (isset .Site.Params "favicon") }}
+  {{ .Scratch.Set "favicon_path" .Site.Params.favicon }}
+{{ else }}
+  {{ .Scratch.Set "favicon_path" "images/favicon.ico" }}
+{{ end }}
+
+{{ $favicon_path := .Scratch.Get "favicon_path" }}
+<link rel="icon" type="image/png" href="{{ $favicon_path }}" />