monkeyWzr / hugo-theme-cactus

Cactus theme for hugo
MIT License
537 stars 338 forks source link

Images are duplicated in post #44

Closed lokamigauti closed 3 years ago

lokamigauti commented 3 years ago

Calling images in a markdown, or Rmarkdown post causes them to appears in the beginning of the post (just link a header/featured image) and in the position where they were called. Follows an example in Hugo 0.81.0:

---
title: bug
author: Kamigauti
date: '2021-04-05'
slug: []
categories:
  - programming
tags:
  - R
  - R Blogdown
draft: no
---

# Here comes a image
image:
![](images/ROD_D_03_PM10_ARM_Unmix.png)

# Here comes another image
another one:
![](images/50049767_1006060356246518_5288004544639235541_n.jpg)

image

I do not know if it is indeed a bug or my lack of knowledge about the theme. Thanks for the attention!

lokamigauti commented 3 years ago

The same in a fresh install in Hugo 0.82.0: image

vdovhanych commented 3 years ago

try using ## and ### for the H1 and H2 insted of just one #. Not seeing this issue.

lokamigauti commented 3 years ago

try using ## and ### for the H1 and H2 insted of just one #. Not seeing this issue.

Same issue usinmg both.

natehn commented 3 years ago

I have no problems using Hugo's figure shortcode

lokamigauti commented 3 years ago

I had the same problem. But, I managed to correct it:

I noted that the figures displayed in the top of the post were not necessarily summoned in the .Rmd (or .md), but just in the child directories (in relation of the file directory, I did not tested more than one level down). Somehow hugo scanned the images of all sub directories, regardless of its name, and rendered the images in the post. Another observation is that the images have links to its original image. So, I created a resources directory above the file dir, and called the image as @natehn suggested (Thank you!):

---
title: bug
author: Kamigauti
date: '2021-04-05'
slug: []
categories:
  - programming
tags:
  - R
  - R Blogdown
draft: no
---

# Here comes a image
image:
{{< figure src="../resources/ROD_D_03_PM10_ARM_Unmix.png" >}}

# Here comes another image
another one:

And it worked. Not as clean as I would like, but it works perfectly. Thanks for the attention.