zwbetz-gh / cupper-hugo-theme

An accessibility-friendly Hugo theme, ported from the original Cupper project.
https://cupper-hugo-theme.netlify.app/
MIT License
301 stars 190 forks source link

Error rendering figure shortcode #12

Closed sumitbirla closed 5 years ago

sumitbirla commented 5 years ago

I am fairly new to Hugo and still learning how to use it, so this error could be a set up error on my part. However, I am unable to use the 'figure' shortcode due to the following error:

{{< figure src="/wp-content/uploads/2007/02/cable_cord.jpg" >}}

hugo/themes/cupper-hugo-theme/layouts/shortcodes/figure.html:22:23": execute of template failed: template: shortcodes/figure.html:22:23: executing "shortcodes/figure.html" at <$original.Permalink>: nil pointer evaluating resource.Resource.Permalink

It appears to be related to permalink. But I can't really tell what I am missing. If I delete the figure.html from the themes directly and use the default Hugo one, it works fine.

zwbetz-gh commented 5 years ago

Hi. So the theme figure shortcode only works for page bundle image resources. For an example usage see https://github.com/zwbetz-gh/cupper-hugo-theme/blob/master/exampleSite/content/post/nasa-images/index.md

sumitbirla commented 5 years ago

Got it. Thanks!

Teebusch commented 4 years ago

It seems that Cupper's figure shortcode masks Hugo's default figure shortcode. The two are different enough that they are both useful in different situations:

I would suggest to rename Cupper's shortcode, so Hugo's can be accessed.

(correct me if I'm wrong. I am new to Hugo)

zwbetz-gh commented 4 years ago

@Teebusch see https://github.com/zwbetz-gh/cupper-hugo-theme/issues/17. I do one issue per GitHub issue to keep things clean.