Archetypes doesn't work

first of all when I create a post normally (with an empty archetypes directory), hugo doesn’t fill the front matter with title and date.
and when I use archetypes (a very simple md file just like the documentation). hugo still ignores it and generates an empty front matter for me.

I use v0.19 (and tried v0.20-DEV) version of hugo on archlinux

  1. I don’t use Linux so my input will likely be limited
  2. I need more information if this is your first Hugo site
    • How are you creating these files with hugo new?
    • Did you create your archetype in archetypes/
    • Do your archetypes and content directories (i.e., sections) mirror one another? (E.g., hugo new post/ is going to look for archetypes/, then archetypes/, and then Hugo’s internal archetype, which adds title, date, and draft = true—note that only title and date will be inherited by all subsequent archetypes.

Hosted git repos are important, especially if this is an actual bug you’re trying to report so that it can be cloned and tested by maintainers of this project.

as I said I did what the docs said.
I’ve tested with both archetypes/ and archetypes/
I’ve created the post with both hugo new post/ and hugo new -k post post/
I’ve tested it with different sites (I’ve created sites just to test this issue)
the important thing is that hugo doesn’t generate even default title and date archetype.

the steps to reproduce the bug on a linux distro with go v1.8:

  1. go get
  2. hugo new site blog
  3. cd blog
  4. hugo new post/
    [ now content/post/ doesn’t have title and date ]
  5. create archetypes/ and write a template
  6. hugo new post/
    [ again content/post/ is empty ]
    this will yield the same result with archetypes/


I’m not able to recreate the problem using Hugo v0.19 linux/amd64.

Before testing, I made sure I do not have an archetypes/ or archetypes/

However, I’m using a theme, and in my theme folder I do have an archetypes/ but it contains only:

When I hugo new post/, it correctly opens my editor with the front matter date and title populated.

The only difference is I’m using hugo installed by npm, rather than downloading the github repo.

1 Like

I opened an issue


Sorry for the confusion, but this line is insufficient:

go get

I have spf13/hugo#3153 on my TODO list (I’ll try to get that fixed today), but here’s the basics:

We use govendor to vendor our library dependencies, but we don’t commit the vendored packages themselves in our git repo. Using go get doesn’t retrieve the vendored dependencies we need. Do this instead:

go get && \
  govendor get

Since you likely already have the Hugo sources, you can use the provided Makefile to do the same thing as above with make install.