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
I don’t use Linux so my input will likely be limited
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/post.md
Do your archetypes and content directories (i.e., sections) mirror one another? (E.g., hugo new post/my-new-post.md is going to look for archetypes/post.md, then archetypes/default.md, 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/default.md and archetypes/post.md
I’ve created the post with both hugo new post/test.md and hugo new -k post post/test.md
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:
go get github.com/spf13/hugo
hugo new site blog
cd blog
hugo new post/test.md
[ now content/post/test.md doesn’t have title and date ]
create archetypes/default.md and write a template
hugo new post/test-2.md
[ again content/post/test-2.md is empty ]
this will yield the same result with archetypes/post.md
Sorry for the confusion, but this line is insufficient:
go get github.com/spf13/hugo
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 github.com/kardianos/govendor && \
govendor get github.com/spf13/hugo
Since you likely already have the Hugo sources, you can use the provided Makefile to do the same thing as above with make install.