diff options
author | Caio Lente <7017340+clente@users.noreply.github.com> | 2023-10-18 23:36:03 -0300 |
---|---|---|
committer | Caio Lente <7017340+clente@users.noreply.github.com> | 2023-10-18 23:36:03 -0300 |
commit | 4edcba8dd16f8e6f9564a2743fe28b7bdfed9784 (patch) | |
tree | 8969b4576e889819c461c7b149f90edd4a78e33d | |
parent | fc8583e4458ee8675b5a982fbdcf523d4f05373e (diff) | |
download | hugo-bearcub-4edcba8dd16f8e6f9564a2743fe28b7bdfed9784.tar.gz hugo-bearcub-4edcba8dd16f8e6f9564a2743fe28b7bdfed9784.tar.bz2 |
Make images work with baseURLs containing a subdir
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | exampleSite/config.toml | 2 | ||||
-rw-r--r-- | layouts/partials/favicon.html | 2 | ||||
-rw-r--r-- | layouts/partials/social_card.html | 4 |
4 files changed, 5 insertions, 5 deletions
@@ -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 }} -<link rel="shortcut icon" href="{{ . }}" />{{ end }} +<link rel="shortcut icon" href="{{ absURL . }}" />{{ 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 @@ <!-- Dynamic social card generation --> {{ $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 |