Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken image rendering #28

Closed
wheleph opened this issue Jul 18, 2021 · 4 comments
Closed

Broken image rendering #28

wheleph opened this issue Jul 18, 2021 · 4 comments

Comments

@wheleph
Copy link

wheleph commented Jul 18, 2021

After upgrading to the latest version of the theme (https://gitlab.com/wheleph/wheleph.gitlab.io/-/commit/974e14a48325fda0baa080c082321dfe38e0ad2b), images in one of my posts can no longer be rendered:

Error: Error building site: "/builds/wheleph/wheleph.gitlab.io/content/posts/2015-06-27-on-rabbitmq-automatic-ack-and-reliable-message-processing/index.md:4:125": execute of template failed: template: _default/_markup/render-image.html:4:125: executing "_default/_markup/render-image.html" at <imageConfig (printf "static/%s" .Destination)>: error calling imageConfig: open /builds/wheleph/wheleph.gitlab.io/static/rabbitmq_auto_ack.png: no such file or directory

Here's the relevant markdown piece:

![Management plugin screenshot: auto ack](rabbitmq_auto_ack.png)

Here's the CI build: https://gitlab.com/wheleph/wheleph.gitlab.io/-/jobs/1433218665

Am I missing something?

@deovaliandro
Copy link

deovaliandro commented Aug 3, 2021

Save all images in static folder under the root folder. So the folder is like this:

├── archetypes
├── config.yaml
├── content
├── layouts
├── README.md
├── static
│   ├── custom_routing.png
│   ├── mikrotik_vpn.png
│   ├── rabbitmq_auto_ack.png
│   ├── rabbitmq_no_auto_ack.png
│   └── vpn_ios.jpeg
└── themes

@WingLim
Copy link
Owner

WingLim commented Aug 12, 2021

With 08a430a, hugo will auto search image in post folder or static folder.

@wheleph
Copy link
Author

wheleph commented Aug 23, 2021

Thank you! With the fix, I'm able to keep images in my posts directories. Just like I did before.

@hurutoriya
Copy link

hurutoriya commented Dec 12, 2021

@WingLim Hello, nice to meet you.
I love your hugo theme, it is a pretty simple and beautiful design 😄

Regarding this updates

With 08a430a, hugo will auto search image in post folder or static folder.

It supported images in post folder but still put the error when I update the hugo-tania theme.

diff --git a/themes/hugo-tania b/themes/hugo-tania
index 0a54b432..99acf147 160000
--- a/themes/hugo-tania
+++ b/themes/hugo-tania
@@ -1 +1 @@
-Subproject commit 0a54b432f9e7318e202760dcd400ab9cefc17882
+Subproject commit 99acf147092a853126c178ffdfaa481ae738d180
Start building sites … 
hugo v0.89.0+extended darwin/amd64 BuildDate=unknown
Error: Error building site: "/Users/hurutoriya/code/hurutoriya.github.io/themes/hugo-tania/layouts/_default/_markup/render-image.html:13:15": execute of template failed: template: _default/_markup/render-image.html:13:15: executing "_default/_markup/render-image.html" at <imageConfig (printf "static/%s" (.Destination | safeURL))>: error calling imageConfig: open /Users/hurutoriya/code/hurutoriya.github.io/static/posts/2017-11-13/images/1.gif: no such file or directory

error messages say broken the post directory images rendering images.
https://github.com/WingLim/hugo-tania/blob/main/layouts/_default/_markup/render-image.html#L13

Actual file structure is here.

I guess _markup/render-image.html build as under /static path even under posts directory but it seems failed?
Sorry I don't have a knowledge about hugo theme but I would like to share it 🙇 .

https://github.com/hurutoriya/hurutoriya.github.io/tree/source/content/posts/2017-11-13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants