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

hugo does not render HTML file when workingdir contains the string "baseof" #4809

Closed
anthonyfok opened this Issue Jun 3, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@anthonyfok
Contributor

anthonyfok commented Jun 3, 2018

Given a working hugo website source residing in: /home/foka/web/anthonyfok.org (i.e., the workingdir), hugo would fail to render the HTML files, yet exit without error, if I were to insert the string "baseof" anywhere in the workingdir, for example:

  • /home/foka/web/baseof-anthonyfok.org
  • /home/foka/baseof/anthonyfok.org
  • /home/foka/web/abaseof
  • /home/foka/web/baseoface

Tested with hugo 0.41, 0.32, 0.24 (no HTML files produced) and 0.16 (zero-byte HTML files)

Discovered this problem while experimenting with #4808 when I started with hugo new site baseof-test and no HTML file was rendered and yet no error was given despite having the minimal layout/_default/baseof.html, layout/_default/index.html and content/_index.md ready, until I, out of desperation, renamed the base directory from baseof-test/ to babababa-test/, and suddenly everything worked.

anthonyfok added a commit to anthonyfok/hugo that referenced this issue Jun 3, 2018

@anthonyfok anthonyfok added the Bug label Jun 3, 2018

@bep

This comment has been minimized.

Member

bep commented Jun 3, 2018

I think that, if we do not already allow baseof-list.html etc., we will probably in the future. The baseof keyword is very distinctive, so this sounds like a non-issue in real life.

anthonyfok added a commit to anthonyfok/hugo that referenced this issue Jun 3, 2018

@anthonyfok

This comment has been minimized.

Contributor

anthonyfok commented Jun 3, 2018

I think that, if we do not already allow baseof-list.html etc., we will probably in the future.

In that case, I'd better change const baseFileBase = "baseof." back to const baseFileBase = "baseof" in PR #4810. :-)

The baseof keyword is very distinctive, so this sounds like a non-issue in real life.

Well, I am that one (?) unlucky soul who ran into this issue in real life and spent over an hour wondering what was going on, haha!

I filed this issue initialy because I didn't expect to be able to find the related code so quickly, but it turns out grep runs did it: git grep baseof and then git grep baseFileBase and then I saw strings.Contains(path, baseFileBase). Changing path to filepath.Base(path) fixes the issue for me.

@anthonyfok anthonyfok added this to the v0.42 milestone Jun 3, 2018

@bep

This comment has been minimized.

Member

bep commented Jun 3, 2018

Ignore my last comment; we have list-baseof.html, but not the other way around, but could we wait a little with this. I'm doing some simplifications with the filesystems etc. that touches this code.

@anthonyfok

This comment has been minimized.

Contributor

anthonyfok commented Jun 3, 2018

but could we wait a little with this. I'm doing some simplifications with the filesystems etc. that touches this code.

Sure, that's perfectly fine. This bug is in no way urgent, especially that I might be the very first person that runs into this corner case in the two years since "block" / "baseof" was introduced two years ago! ;-) It is in your hands now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment