hugo: hugo new fails when no archetype files

➜  bookshelf git:(master) ✗ hugo new post/axxxx.md -v
INFO 2017/06/22 13:15:16 Using config file:
INFO 2017/06/22 13:15:16 attempting to create "post/axxxx.md" of "post" of ext ".md"
Error: open : no such file or directory
➜  bookshelf git:(master) ✗ hugo version
Hugo Static Site Generator v0.25-DEV linux/amd64 BuildDate: 2017-06-22T11:30:10+08:00
➜  bookshelf git:(master) ✗ uname -a
Linux tjwq01-ibu-video007106.tjwq01.ksyun.com 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 16 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I am seeing this issue using the Ubuntu 16.04 Hugo package and following the official tutorial at step 4.

Looks like the package is pretty old, I guess I’ll build from source.

$ hugo version
Hugo Static Site Generator v0.16-DEV BuildDate: 2016-02-06T09:14:17-08:00

I’m running GalliumOS on an Acer Chrombook 11.

I had the same issue. If you are on Ubuntu (or any Ubuntu-based machine), don’t install from apt-get. This will only install a much older version. Go here and download the latest .deb file (either 32 or 64-bit). I did this and was able to generate my site!

Hi @kgilmer,

You may also try to install the Hugo .deb package from Ubuntu 18.04 LTS or even in cosmic, see https://packages.ubuntu.com/hugo

Another option is to use the Hugo snap by running snap install hugo (might need to use sudo).

Thank you for reporting this, @jinleileiking!

I was able to reproduce this in a freshly created Hugo site where hugo new site is just run and archetypes/ contains no file in v0.24.

Temporary workaround: Create an archetypes/default.md file with the following minimal content:

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