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

UTF-8-BOM In Layouts Results In Blank Page #4895

crash-dive opened this Issue Jul 1, 2018 · 3 comments


None yet
2 participants

crash-dive commented Jul 1, 2018

Hugo Version: v0.42.2 windows/amd64 BuildDate: 2018-06-28T12:36:53Z
OS: Windows 10

When certain layouts files start with a BOM the pages fail to render. This does not impact all files though.

Our layout folder contains:

  • _default
    • baseof.html
    • home.html
    • section.html
    • single.html
  • partials
    • services.html
  • shortcodes
    • partial.html

The shortcodes and partials work perfectly fine when they have a BOM. In _default baseof.html works fine with a BOM, however home, section & single do not. When they have a BOM the rendered page is just blank. All our content files have BOMs.

The home, section and single files are really simple and look like:

{{ define "main" }}
    {{ .Content }}
{{ end }}

Other people have had this problem

This can obviously be fixed by changing the encoding of the file but all our projects are standardised on with a BOM so it would be great if all files could be the same.


This comment has been minimized.

stale bot commented Oct 29, 2018

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Oct 29, 2018

@bep bep added the Keep label Oct 29, 2018

@stale stale bot removed the Stale label Oct 29, 2018

@bep bep added this to the v0.51 milestone Oct 29, 2018

@bep bep added the Bug label Oct 29, 2018


This comment has been minimized.


bep commented Oct 30, 2018

This looks like a bug in Go: golang/go#28482

I will work around it at our end by trimming away the BOM marker before we send it to the Go parser.

bep added a commit to bep/hugo that referenced this issue Oct 30, 2018

@bep bep closed this in #5382 Oct 30, 2018

bep added a commit that referenced this issue Oct 30, 2018


This comment has been minimized.

crash-dive commented Oct 30, 2018

@bep Just wanted to say thanks for reviewing and fixing this. Hugo is a great tool and all the work done on it is really appreciated!

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