Open solrayc opened 4 years ago
First idea would be:
section = "/blog"
instead of section = blog
First idea would be:
section = "/blog"
instead ofsection = blog
My current setup is section = "blog"
. I forgot to add "" in my message earlier, sorry.
List fragment works as it should, except for when I set the image in content/blog/article-1/index.md
, like so:
[asset]
image = "image.png"
Just like on Syna fragments example site.
Setting section = "/blog"
in list fragment works the same way.
This might be related to #630 as both are issues with Windows based setups. Does this work by using Linux?
This might be related to #630 as both are issues with Windows based setups. Does this work by using Linux?
Looks like a windows issue. I encountered something similar with Hugo for Windows a while back with a different theme. Will test it out on Linux and report back.
Does this work by using Linux?
Just tested it with Linux and it works. I believe it is an issue with Windows based setups.
Is this an issue with image fallthrough or image processing in Hugo for Windows environment? I want to create an issue on this in Hugo community forum, but I don't really understand where the problem is. Can you assist me with correct description of this issue?
I tested on Debian WSL on Windows 10.
Hugo Static Site Generator v0.54.0/extended linux/amd64 BuildDate: 2019-06-04T19:16:36Z
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.11.6"
Syna version v0.14 Used older version of Syna, because I couldn't figure out how to update Hugo to latest version on Debian. I would've had to compile Hugo from source and that's just too many hoops to jump through.
Added this issue to Hugo forum https://discourse.gohugo.io/t/syna-theme-image-fallthrough-fails-on-windows-but-works-on-linux/21889
Similar to #630
Thanks for filing
@mpourismaiel Let's document this issue for windows and think about a possible solution. Most likely our code assuming path "/" separators for building paths or?
Do we need to use "\" for Windows? I thought Go or Hugo would handle that. I'll document the incompatibility for now and later maybe find a fix for it. Does the image appear if it's inside static
directory? Is the problem restricted to fragment and page level fallthrough?
Does the image appear if it's inside
static
directory?
No, it does not. Errors are slightly different though.
Here are the errors I get when I set an image to be from static
directory. On Windows:
Change detected, rebuilding site.
2019-12-04 19:27:04.365 +0800
Source changed "C:\\Users\\solrayc\\Desktop\\synastartergit\\syna-start\\content\\services\\berries\\index.md": WRITE
ERROR 2019/12/04 19:27:04 render of "home" failed: execute of template failed: template: _default\list.html:9:7:
executing "_default\\list.html" at <partial "helpers/fragments-renderer.html" (dict "page_scratch" .Scratch)>: error calling partial: execute of template failed: template: partials/helpers/fragments-renderer.html:18:8: executing "partials/helpers/fragments-renderer.html" at <partial (print "fragments/" .Params.fragment ".html") $context>: error calling partial: "C:\Users\solrayc\Desktop\synastartergit\syna-start\themes\syna\layouts\partials\fragments\list.html:31:8": execute of template failed: template: partials/fragments/list.html:137:30: executing "partials/fragments/list.html" at <partial "helpers/image.html" (dict "root" $root "asset" .Params.asset)>: error calling partial: "C:\Users\solrayc\Desktop\synastartergit\syna-start\themes\syna\layouts\partials\helpers\image.html:31:8": execute of template failed: template: partials/helpers/image.html:31:8: executing "partials/helpers/image.html" at <fileExists (printf "content/%s" $location)>: error calling fileExists: CreateFile C:\Users\solrayc\Desktop\synastartergit\syna-start\content\%!s(<nil>)\header.jpg: The filename, directory name, or volume label syntax is incorrect.
ERROR 2019/12/04 19:27:04 render of "page" failed: execute of template failed: template: _default\single.html:9:7: executing "_default\\single.html" at <partial "helpers/fragments-renderer.html" (dict "page_scratch" .Scratch)>: error calling partial: execute of template failed: template: partials/helpers/fragments-renderer.html:18:8: executing "partials/helpers/fragments-renderer.html" at <partial (print "fragments/" .Params.fragment ".html") $context>: error calling partial: "C:\Users\solrayc\Desktop\synastartergit\syna-start\themes\syna\layouts\partials\fragments\list.html:31:8": execute of template failed: template: partials/fragments/list.html:137:30: executing "partials/fragments/list.html" at <partial "helpers/image.html" (dict "root" $root "asset" .Params.asset)>: error calling partial: "C:\Users\solrayc\Desktop\synastartergit\syna-start\themes\syna\layouts\partials\helpers\image.html:31:8": execute of template failed: template: partials/helpers/image.html:31:8: executing "partials/helpers/image.html" at <fileExists (printf "content/%s" $location)>: error calling fileExists: CreateFile C:\Users\solrayc\Desktop\synastartergit\syna-start\content\%!s(<nil>)\header.jpg: The filename, directory name, or volume label syntax is incorrect.
Total in 220 ms
ERROR 2019/12/04 19:27:04 Rebuild failed:
ERROR 2019/12/04 19:27:04 Failed to render pages: render of "page" failed: execute of template failed: template:
_default\single.html:5:6: executing "_default\\single.html" at <partial "head.html" .>: error calling partial: "C:\Users\solrayc\Desktop\synastartergit\syna-start\themes\syna\layouts\partials\head.html:31:8": execute of template failed: template: partials/head.html:35:46: executing "partials/head.html" at <partial "helpers/image.html" (dict "root" $root "asset" .Params.asset "absolute" true)>: error calling partial: "C:\Users\solrayc\Desktop\synastartergit\syna-start\themes\syna\layouts\partials\helpers\image.html:31:8": execute of template failed: template:
partials/helpers/image.html:31:8: executing "partials/helpers/image.html" at <fileExists (printf "content/%s" $location)>: error calling fileExists: CreateFile C:\Users\solrayc\Desktop\synastartergit\syna-start\content\%!s(<nil>)\header.jpg: The filename, directory name, or volume label syntax is incorrect.
Everything works well on Debian WSL, Windows 10.
I recommend using WSL and building on Linux or using WSL for production as well. Supporting Windows is kinda hard and time consuming since none of us have a Windows development environment. We will investigate the issue given the chance. We are always happy to receive Pull Requests to improve our Windows support. I'm sorry for the inconvenience.
To add a last comment for now. We mainly support linux based systems. We'll leave this open to track and figure out what's the culprit over the long term. Assuming it might be due to our fragment logic, that adds "/" separators that are linux only.
Is this a BUG REPORT or FEATURE REQUEST?: bug
What happened: I have
content/_index/services.md
list fragment with front matter parametersection = blog
. Incontent/blog/chocolate/
I have content fragmentindex.md
and an imageimage.png
.Hugo throws an error when I set an image in fragment
index.md
, like so:Here are the errors I get
What you expected to happen: I expected to see a thumbnail image for the blog post in the list fragment on my homepage. How to reproduce it (as minimally and precisely as possible):
You can reproduce this issue with my repo by uncommenting
in
content/blog/chocolate/index.md
Anything else we need to know?: I tried Hogo versions 0.58.3 and 0.59.1. Both throw the same error. I fully rely on themes build in partials. I do not have any custom partials. Environment: