# Strange behavior, (maybe ?) not a bug but could interest you

**URL:** <https://discourse.gohugo.io/t/strange-behavior-maybe-not-a-bug-but-could-interest-you/44076>\
**Category:** dev\
**Created:** [April 25, 2023, 9:10pm UTC](https://discourse.gohugo.io/t/strange-behavior-maybe-not-a-bug-but-could-interest-you/44076 "2023-04-25T21:10:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Durand](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tom_durand/32/14460_2.png) [@Tom\_Durand](https://discourse.gohugo.io/u/Tom_Durand)\
**Post date:** [April 25, 2023, 9:10pm UTC](https://discourse.gohugo.io/t/strange-behavior-maybe-not-a-bug-but-could-interest-you/44076/1 "2023-04-25T21:10:42Z")

</div>

Something funny happened, an issue solved now but still puzzling as I can still reproduce the behavior. Maybe that feedback could be of interest to developers. I am not sure if you guys would consider this a bug or just a counter-intuitive behavior 🤔

I had a shortcode with this:

> \<figure class=“aside”\>  
> {{ .Inner | markdownify }}  
> \</figure\>

and it used to work. then I needed a render-image.html specific to the homepage so I added “type: home” added to its frontmatter and made it, fine, but too fine: it created that error on a template not used at all on the homepage but in other pages:

> kiddygirland.md:162:1": failed to render shortcode “ff”: failed to process shortcode: “ff.html:2:12”: execute of template failed at : error calling markdownify: “/home/drm/WEBSITE/content/\_index.md:1:1”: “/home/drm/WEBSITE/themes/hugo-book/layouts/home/\_markup/render-image.html:17:13”: execute of template failed at \<$img.Width\>: error calling Width: this method is only available for image resources  
> /home/drm/WEBSITE/content/docs/Love/Anime\_analysis/kiddygirland.md:162:1:

I substitute the `.Page.RenderString` method to the obsolete `markdownify` and now it’s fine. I’m probably missing key differences between those functions/methods, but I wonder, why did it complain now and mentioned the homepage which doesn’t use this shortcode ?!  
It mentioned:

```auto
/home/drm/WEBSITE/content/_index.md:1:1:
---
title: Purpose of this website

```

and:

> /home/drm/WEBSITE/themes/hugo-book/layouts/home/\_markup/render-image.html:16:13:  
> {{ if gt $img.Width 1540 }}

* * *

Versions:  
Linux drm-4236wv5 6.2.9-arch1-1 #1 SMP PREEMPT\_DYNAMIC Thu, 30 Mar 2023 14:51:14 +0000 x86\_64 GNU/Linux  
hugo v0.111.3-5d4eb5154e1fed125ca8e9b5a0315c4180dab192+extended linux/amd64 BuildDate=2023-03-12T11:40:50Z VendorInfo=gohugoio

---

<div class="post-metadata">

**Author:** ![JemmsUK](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jemmsuk/32/21240_2.png) [@JemmsUK](https://discourse.gohugo.io/u/JemmsUK)\
**Post date:** [March 5, 2025, 12:32pm UTC](https://discourse.gohugo.io/t/strange-behavior-maybe-not-a-bug-but-could-interest-you/44076/2 "2025-03-05T12:32:38Z")

</div>

Thank you for posting this, it solved a problem for me as well

I was looking to have a multi-line figcaption.  
The text of the figcaption was in frontmatter i.e

```auto
 imagecredit = '''
Photograph Harvey Metcalfe (1928), from Harry Price.\
Leaves from a Psychist's Case-Book (Victor Gollancz Ltd, 1933) [1]
'''

```

and it started working once I used this in the template  
`{{ $imagecredit := .Page.Params.imagecredit | markdownify }}`

for the html

```auto
<figcaption>Image credit: {{ $imagecredit }}</figcaption>

```

so it rendered as:

Image credit: Photograph Harvey Metcalfe (1928), from Harry Price.  
Leaves from a Psychist’s Case-Book (Victor Gollancz Ltd, 1933) [1]

Hugo version: hugo v0.145.0-666444f0a52132f9fec9f71cf25b441cc6a4f355+extended windows/amd64 BuildDate=2025-02-26T15:41:25Z VendorInfo=gohugoio

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [April 6, 2025, 12:02pm UTC](https://discourse.gohugo.io/t/strange-behavior-maybe-not-a-bug-but-could-interest-you/44076/3 "2025-04-06T12:02:58Z")

</div>

Closed on April 6, 2025, 12:02pm UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
