Hugo: EOF Troubleshooting Tips Not Working

Created on 3 Jul 2018  路  3Comments  路  Source: gohugoio/hugo

Error Message

Expected a top-level item to end with a new line, comment or EOF, but got '-' instead.

Version

Hugo Static Site Generator v0.14 BuildDate: 2015-05-26T01:29:16Z

Notepad ++ showing EOF's

https://imgur.com/a/iq47xLW

Relevant STRACE error

open("/var/www/html/dirtysj/archetypes/default.md", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0777, st_size=105, ...}) = 0
read(3, "+++\ntitle = \"{{ replace .Transla"..., 617) = 105
read(3, "", 512)                        = 0
close(3)                                = 0
write(1, "ERROR: 2018/07/03 Near line 2 (l"..., 139ERROR: 2018/07/03 Near line 2 (last key parsed ''): Expected a top-level item to end with a new line, comment or EOF, but got '-' instead.
) = 139

archetype/default.md

title = "{{ replace .TranslationBaseName "-" " " | title }}"
date = {{ .Date }}
draft = true
+++

Most helpful comment

Your suggestion worked!

I was following this tutorial from DigitalOcean

The line in question was wget https://github.com/spf13/hugo/releases/download/v0.14/hugo_0.14_amd64.deb

I had to uninstall and reinstall Hugo by doing the following

Uninstall

sudo apt-get remove hugo
sudo apt-get remove --auto-remove hugo
sudo apt-get purge hugo
sudo apt-get purge --auto-remove hugo

Reinstall Latest Version

sudo wget https://github.com/gohugoio/hugo/releases/download/v0.42.2/hugo_0.42.2_Linux-64bit.deb
sudo dpkg -i hugo_0.42.2_Linux-64bit.deb

All 3 comments

v0.14 might be a bit outdated. Can you upgrade to the latest release (v0.42.2)?

I am also not sure if template functions work inside Front Matter.

Your suggestion worked!

I was following this tutorial from DigitalOcean

The line in question was wget https://github.com/spf13/hugo/releases/download/v0.14/hugo_0.14_amd64.deb

I had to uninstall and reinstall Hugo by doing the following

Uninstall

sudo apt-get remove hugo
sudo apt-get remove --auto-remove hugo
sudo apt-get purge hugo
sudo apt-get purge --auto-remove hugo

Reinstall Latest Version

sudo wget https://github.com/gohugoio/hugo/releases/download/v0.42.2/hugo_0.42.2_Linux-64bit.deb
sudo dpkg -i hugo_0.42.2_Linux-64bit.deb

Glad I could help!

Was this page helpful?
0 / 5 - 0 ratings