Open mmartinortiz opened 1 month ago
Use {{< figure src="/path/to/image.jpg" caption="Caption for Image" attrlink="" >}}
. It should work, please check your images are in the asset folder or not.
Thanks for your answer.
Using {{< figure ... >}}
does not work either. I have pushed the suggested change to this branch of my website. The modified file is this one, and all the images are under the /assets/img folder.
I tried multiple combinations for the image path:
/img/rgb-flowers-2.jpg
img/irgb-flowers-2.jpg
/assets/img/rgb-flowers-2.jpg
assets/img/rgb-flowers-2.jpg
If I understood correctly, the documentation indicates that /assets
is not required, and the absolute path needs to start right after /assets
.
Can you please take the latest theme and try.
After
git submodule update --recursive --remote
I get the following error:
Error: error building site: render: failed to render pages: render of "section" failed: "/home/user/Projects/website/themes/lightbi-hugo/layouts/about/about.html:8:27": execute of template failed: template: about/about.html:8:27: executing "main" at <$image.RelPermalink>: nil pointer evaluating resource.Resource.RelPermalink
If I clone the demo website, the same error does not show up. I noticed that the theme is under a different folder.
My .gitsubmodule
[submodule "themes/lightbi-hugo"]
path = themes/lightbi-hugo
url = https://github.com/binokochumolvarghese/lightbi-hugo
Demo's website .gitsubmodule
[submodule "themes/themes/lightbi-hugo"]
path = themes/themes/lightbi-hugo
url = https://github.com/binokochumolvarghese/lightbi-hugo
Is it relevant?
Even though, in the demo website the post Markdown Syntax Guide, which contains an image, the image is not rendered in the post.
I downloaded the theme locally and its running fine. Can you try that also? Also the figure shortcode is working in the demo. You can try that.
When the images are taking from the assets folder Markdown Syntax is not working, I will check the same.
I just cloned the theme and copied it inside my website's themes
folder. The error about the pointer is gone, but the images are still not displayed. I used exactly the syntax of the demo, including some variants with the paths:
{{< figure src="/img/epuck.jpg" caption="With caption." attrlink="" >}}
{{< figure src="img/rgb-flowers-2.jpg" caption="Caption for Image" attrlink="" >}}
{{< figure src="/img/rgb-flowers-2.jpg" caption="Caption for Image" attrlink="" >}}
{{< figure src="assets/img/rgb-flowers-2.jpg" caption="Caption for Image" attrlink="" >}}
{{< figure src="/assets/img/rgb-flowers-2.jpg" caption="Caption for Image" attrlink="" >}}
An important difference I noticed between the demo and my website, is that the images are located in different places:
assets/img
folder. The images here are found and used as the main picture of the post, the keyword image
used by Hugo./img/posts/img-3.jpg
on two different locations: Under themes/lightbi-hugo/assets
and public
In my website I've defined in the hugo.toml
file the location of staticDirs
under ["static", "assets"]
, but the demo site does not define the staticDirs
variable.
Hi,
When I try to add an extra image to my posts, the image appears as a broken link. I've used the markdown syntax as the figure shortcut, but none of them worked.
In this sample page the image also appears as a broken link.