mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
190964c57b
With two entries of frequently encountered or obscured troubles so far: - "Categories with accented characters" Unicode NFC/NFD mismatch on Mac OS X (See #739) - `hugo new` aborts with cryptic EOF error (See #776)
1.9 KiB
1.9 KiB
date | menu | title | weight | ||||
---|---|---|---|---|---|---|---|
2015-01-08T16:11:23-07:00 |
|
Strange EOF error | 5 |
Trouble: hugo new
aborts with cryptic EOF error
I'm running into an issue where I cannot get archetypes working, when running hugo new showcase/test.md
, for example, I see an EOF
error thrown by Hugo.
I have set up this test repository to show exactly what I've done, but it is essentially a vanilla installation of Hugo. https://github.com/polds/hugo-archetypes-test
When in that repository, using Hugo v0.12 to run hugo new -v showcase/test.md
, I see the following output:
INFO: 2015/01/04 Using config file: /private/tmp/test/config.toml
INFO: 2015/01/04 attempting to create showcase/test.md of showcase
INFO: 2015/01/04 curpath: /private/tmp/test/archetypes/showcase.md
ERROR: 2015/01/04 EOF
Is there something that I am blatantly missing?
Solution
Thank you for reporting this issue. The solution is to add a final newline (or EOL) to the end of your default.md archetype file of your theme. More discussions happened on the forum here:
- http://discuss.gohugo.io/t/archetypes-not-properly-working-in-0-12/544
- http://discuss.gohugo.io/t/eol-f-in-archetype-files/554
So yes, we do need to fix this. We need to do the following:
- Add warnings about this in the Hugo documentation, as several people have run into the same problem already. (Users of editors like Vim, nano and gedit are immune to this because these editors enforce an EOL at the end of the file by default, but other editors like Emacs don't do that.)
- Improve the error message. It is difficult to determine what went wrong with just three characters "
EOF
" - Allow archetype files without the final EOL to compile anyway, but do give an appropriate and detailed warning. (optional, to be discussed) https://github.com/spf13/hugo/issues/776