HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.19k stars 2.9k forks source link

Bad error message when Emacs auto-saves a file #1599

Closed RDMelamed closed 4 years ago

RDMelamed commented 4 years ago

Describe the bug

A clear and concise description of what the bug is.

Bad error message when Emacs auto-saves a file (ie, .#_index.md -> melamed@Rachels-Air-2.home.56 ). The error message comes up when you start the server and does not help locate the problem:

hugo server -D Building sites … ERROR 2020/03/15 21:10:22 Homepage not found or duplicate homepages detected for a localization! Add the home/ folder (especially /home/index.md) to each language's content folder. For example, your site should have a content/home/ folder containing index.md and your homepage sections, or for multi-language sites, content/en/home/ and content/zh/home/ etc. Refer to the 'Build Your Homepage' and 'Language' documentation at https://sourcethemes.com/academic/docs/ and the example homepage at https://github.com/gcushen/hugo-academic/tree/master/exampleSite/content/home/index.md . Built in 173 ms Error: Error building site: logged 1 error(s)

To Reproduce

Steps to reproduce the behavior (on the exampleSite):

  1. Open content/authors/admin/_index.md in emacs
  2. Edit it the shell instead and do not read in the new version of the file. This will cause emacs to save an auto-recovery file such as ".#_index.md..
  3. Run hugo server -D and you will get that cryptic message.

Expected behavior

A more clear error message about what the problem is, or perhaps learn to ignore these emacs files.

Technical details:

gcushen commented 4 years ago

Can you not tell Hugo to ignore your temporary Emacs files by adding them to Hugo's ignoreFiles in config.toml?

RDMelamed commented 4 years ago

Yes you can, but the problem is I had no idea that was the problem because of the uninformative error message and basically reconstructed my whole site before finding it.

gcushen commented 4 years ago

This error can occur when Hugo fails to load a Markdown page in Academic. We can improve the error message here but it has its limitations as Hugo does not currently provide much useful info in its error messages, although I understand Hugo team have an issue open to improve that. Also, Hugo generally doesn't play well with temporary editor files at the moment, another upstream issue.