添加图像到使用hugo框架的网页 [英] Add image to webpage which uses hugo framework

查看:1644
本文介绍了添加图像到使用hugo框架的网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站托管在GitLab Pages上,并使用Hugo框架(v0.23) 。我从这里分叉我的网页, https://gitlab.com/pages/hugo (因此我的博客文件夹结构是一样的)。



我的内容发布并且存储在这里:home / content / post



我创建了一个文件夹这里的图片:home / content / post / images



当我插入图片到图片后,图片将不会发布。我试过在下面的帖子中使用相关的短代码,但没有运气:


  1. {{< figure src =image / image_name.pngtitle =image title>}}

  2. {{< figure src =/ image / image_name.pngtitle =image title>}}

其中:


  • 图像存储在此处:home / content / post / images / image_name.png
  • :home / content / post / post_title.md



我怀疑问题是我添加的新图像文件夹不知何故被看到 。



请帮忙!

解决方案

我指的是错误的途径。 D'oh!



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

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!

解决方案

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

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

这篇关于添加图像到使用hugo框架的网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆