Add image to webpage which uses hugo framework

微笑、不失礼 提交于 2019-12-12 05:11:51

问题


I want to post an image onto my blog (yes that simple!)

My website is hosted on GitLab Pages and uses the Hugo framework (v0.23). I forked my webpage from here, https://gitlab.com/pages/hugo (thus my blog folder structure is the same).

My content publishes fine and is stored here: home/content/post

I created a folder which stores images here: home/content/post/images

When I insert an image into a post the image won't publish. I've tried using the relevant short code in the post (below) with no luck:

  1. {{< figure src="image/image_name.png" title="image title" >}}
  2. {{< figure src="/image/image_name.png" title="image title" >}}

where:

  • the image is stored here: home/content/post/images/image_name.png
  • the post is stored here: home/content/post/post_title.md

I suspect the problem is the new images folder I added is somehow not "seen".

Please help!


回答1:


The problem was easily fixed, I was pointing to the wrong pathway. D'oh!

{{< figure src="../image/image_name.png" title="image title" >}}



来源:https://stackoverflow.com/questions/46787540/add-image-to-webpage-which-uses-hugo-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!