From 4edcba8dd16f8e6f9564a2743fe28b7bdfed9784 Mon Sep 17 00:00:00 2001
From: Caio Lente <7017340+clente@users.noreply.github.com>
Date: Wed, 18 Oct 2023 23:36:03 -0300
Subject: Make images work with baseURLs containing a subdir
---
README.md | 2 +-
exampleSite/config.toml | 2 +-
layouts/partials/favicon.html | 2 +-
layouts/partials/social_card.html | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index ef4e9cd..d6d242c 100644
--- a/README.md
+++ b/README.md
@@ -187,7 +187,7 @@ enableRobotsTXT = true
# to your site. Ignored if `generateSocialCard = true`. For more information
# about previews, see https://gohugo.io/templates/internal#twitter-cards and
# https://gohugo.io/templates/internal#open-graph
- images = ["/hugo-bearcub/images/share.webp"]
+ images = ["images/share.webp"]
# This title is used as the site_name on the Hugo's internal opengraph
# structured data template
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index b9fc796..d5eff2b 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -53,7 +53,7 @@ enableRobotsTXT = true
# to your site. Ignored if `generateSocialCard = true`. For more information
# about previews, see https://gohugo.io/templates/internal#twitter-cards and
# https://gohugo.io/templates/internal#open-graph
- images = ["/hugo-bearcub/images/share.webp"]
+ images = ["images/share.webp"]
# This title is used as the site_name on the Hugo's internal opengraph
# structured data template
diff --git a/layouts/partials/favicon.html b/layouts/partials/favicon.html
index 80f6aca..d391a86 100644
--- a/layouts/partials/favicon.html
+++ b/layouts/partials/favicon.html
@@ -1,2 +1,2 @@
{{ with .Site.Params.favicon }}
-{{ end }}
+{{ end }}
diff --git a/layouts/partials/social_card.html b/layouts/partials/social_card.html
index 8bf397f..68bb4ca 100644
--- a/layouts/partials/social_card.html
+++ b/layouts/partials/social_card.html
@@ -1,7 +1,7 @@
{{ $font := resources.GetRemote "https://github.com/google/fonts/raw/main/ofl/firamono/FiraMono-Bold.ttf" }}
-{{ $fg := resources.Get "/images/social_card_fg.png"}}
-{{ $bg := resources.Get "/images/social_card_bg.png"}}
+{{ $fg := resources.Get "images/social_card_fg.png"}}
+{{ $bg := resources.Get "images/social_card_bg.png"}}
{{ $fg = $fg.Filter (images.Text .Title (dict
"font" $font
--
cgit v1.2.3