I did some tests, and finally noticed that archetypes/showcase.md contains no EOL (end-of-line) after the final +++:
+++
somevar = "testing"
+++
Please try adding an EOL at the very end manually, or by changing your editor setting not to strip EOL at the end of the file, and try running hugo new -v showcase/test.md again.
Perhaps Hugo needs to be modified to be able to handle such “[noeol]” files?
That was exactly the issue. Looking back over the documentation I didn't see any indication of needing a new line at the end of a file. Perhaps either adding support for noeol as you mentioned or at least updating the documentation with that note might be worth the trouble?
I did some tests, and finally noticed that archetypes/showcase.md contains no EOL (end-of-line) after the final +++:
+++
somevar = "testing"
+++
Please try adding an EOL at the very end manually, or by changing your editor setting not to strip EOL at the end of the file, and try running hugo new -v showcase/test.md again.
Perhaps Hugo needs to be modified to be able to handle such "[noeol]" files?
I just wasted 20 minutes going WFT until I decided to search the forum. So I agree with @Mteigers at the very least this needs to be in the documentation (asap) and, as commented, have hugo deal with the lack of a last EOL(F) in the next release.
When you shout out about “wasting 20 minutes” and “going WTF” and “this needs to be in the documentation (asap)”, please remember that this is free software, developed by people who do it because they think it’s fun. Some of us “waste” a lot more than 20 minutes doing this.
If you want it in the documentation ASAP, the fastest known way is to do it yourself.
@bjornerik I didn’t shout anything. WTF was a question to myself. I have in the past edited the hugo documentation and can do so again. And I have on several occasions thanked Steve and Nate for their work.
It’s OK to blow some steam. It was just the “wasted 20 minutes” “must be fixed asap” that bugged me a little. As 20 minutes is a drop in the Open Source sea.
beside what @anthonyfok added to the troublehooting section I just added this simiple note below to achetype.md and put in a pull request. Hopefullly they can actually update the doc website now and not wait until new hugo release.
NOTE: Some editors (e.g. Sublime) do not insert an EOL at the last line. If you get an EOF error using hugo new type a carriage return after the closing +++ in each archetype file.