Skip to content

Commit

Permalink
Make images work with baseURLs containing a subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
clente committed Oct 19, 2023
1 parent fc8583e commit 4edcba8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/favicon.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{ with .Site.Params.favicon }}
<link rel="shortcut icon" href="{{ . }}" />{{ end }}
<link rel="shortcut icon" href="{{ absURL . }}" />{{ end }}
4 changes: 2 additions & 2 deletions layouts/partials/social_card.html
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4edcba8

Please sign in to comment.