【问题标题】:How to add image to hugo with local and remote如何使用本地和远程将图像添加到 Hugo
【发布时间】:2022-11-12 18:25:19
【问题描述】:

我想将图像添加到 hugo 的 md 文件中。我想在本地和网站上看到它,并使用一个目录来存储它。所以我尝试将它放在/content/posts/image/xxx.img 上并用![](/content/posts/images/2022-11-10-17-33-49.png) 编写md 文件,它可以在vscode 中工作,但不能在网站上工作。有没有办法得到它?

【问题讨论】:

  • 你是如何部署网站的?你也上传图片了吗?当您说它在 VSCode 中有效时,您是指在 Markdown 预览中吗?

标签: hugo


【解决方案1】:

在雨果https://discourse.gohugo.io/t/how-to-add-image-to-hugo-with-local-and-remote/41391/8中找到它

答案是更改 conf 文件。

[[module.mounts]]
source = 'static'
target = 'static'

[[module.mounts]]
source = 'images'
target = 'static/images'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-16
    • 1970-01-01
    • 2014-08-20
    • 2018-05-31
    • 2021-05-21
    • 2021-04-07
    • 1970-01-01
    • 2011-02-08
    相关资源
    最近更新 更多