Closed biodranik closed 6 years ago
slug: очень-длинная-строка-для-того-чтобы-крешнуть-самый-лучший-статический-генератор
Does it crash if you make the above ... short?
No, but incorrectly generates percent-encoded path, as I described in comments to the slug.
No, but incorrectly generates percent-encoded path,
Can you create a separate issue for that.
The fix for this particular issue is to not panic, i.e. return a proper error that gets logged. The "filename too long" is OS dependent and not something we want to validate.
Just checked, /bin/mkdir
has a hard-coded limit of 256 characters in the path on Mac OS X 10.13
However, this panic is a minor issue, the major one is that any .Resource generates an incorrect percent-encoded path.
Howewer, this panic is a minor issue, the major one is that any .Resource generates an incorrect percent-encoded path.
Sure. But you use an ascii slug and it will work.
It's inconsistent with alias
in FrontMatter which correctly generates UTF-8 encoded folders for index.html. Why does slug
use percent-encoding but alias
does not?
No, it is even worse: alias
and slug
work in the same way (correctly) without any images in subsection (.Page.Resource), but if you put any image slug
stops working.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I'm using Mac OS X 10.13.2. This is content which causes bug:
Detailed bug description is below:
I see at least two erors:
mkdir: file name is too long
goroutine 27 [running]: log.Panicln(0xc420ccb900, 0x1, 0x1) /usr/local/Cellar/go/1.9.2/libexec/src/log/log.go:340 +0xc0 github.com/gohugoio/hugo/vendor/github.com/spf13/afero.WriteReader(0x2b07360, 0x2b8ce00, 0xc4210ba000, 0x22e, 0x2afb0e0, 0xc4208739e8, 0x2afb1a0, 0xc420e80d20) /private/tmp/hugo-20180108-44182-1t9hvji/hugo-0.32.3/src/github.com/gohugoio/hugo/vendor/github.com/spf13/afero/util.go:49 +0x24f github.com/gohugoio/hugo/helpers.WriteToDisk(0xc4210ba000, 0x22e, 0x2afb0e0, 0xc4208739e8, 0x2b07360, 0x2b8ce00, 0x0, 0xc420f8b480) /private/tmp/hugo-20180108-44182-1t9hvji/hugo-0.32.3/src/github.com/gohugoio/hugo/helpers/path.go:532 +0x5d github.com/gohugoio/hugo/resource.(genericResource).Publish(0xc4212a1570, 0x0, 0x0) /private/tmp/hugo-20180108-44182-1t9hvji/hugo-0.32.3/src/github.com/gohugoio/hugo/resource/resource.go:272 +0x1da github.com/gohugoio/hugo/hugolib.(PageOutput).renderResources(0xc420f8b440, 0xc420ffc0a0, 0x1a61b01) /private/tmp/hugo-20180108-44182-1t9hvji/hugo-0.32.3/src/github.com/gohugoio/hugo/hugolib/page_output.go:294 +0xd1 github.com/gohugoio/hugo/hugolib.pageRenderer(0xc42035b8c0, 0xc420c7a840, 0xc420c7a7e0, 0xc421535fe0) /private/tmp/hugo-20180108-44182-1t9hvji/hugo-0.32.3/src/github.com/gohugoio/hugo/hugolib/site_render.go:115 +0xa29 created by github.com/gohugoio/hugo/hugolib.(*Site).renderPages /private/tmp/hugo-20180108-44182-1t9hvji/hugo-0.32.3/src/github.com/gohugoio/hugo/hugolib/site_render.go:45 +0x153