Hugo not finding archetypes?

When I run hugo new post/first.md it doesn’t seem to find the proper archetype file that I have placed in my working director.

Here is my current directory structure:

site
    +archetypes
        -post.md
        -thoughts.md
    +content
        +post
             -first.md
         +thoughts
              -second.md
    +layout
     ...

I’m currently running hyde as the base theme and whenever I do hugo new thoughts/second.md or whatever instead of looking through my working directory first, it applies the default.md file from hyde immediately.

Is there some obvious thing I’m missing?

No, that should work (just tested your example).

  • What is your output of hugo version
  • What OS are you running (WIndows?)

hugo version prints out v0.13 . I’m running Windows 7.

I’m sitting on a Linux box right now (if someone else could test it on Windows that would be great).

Can you try

hugo new -k post post/first.md

And see if that picks the correct archetype.

yes it does work when I do that and that is what I’ve been doing right now. It’s just that I would like to enjoy the benefits of hugo’s semantic archetype selection. The strange thing is that hugo can find the archetypes when I explicitly state them with the -k options so it has no problem finding my directory or the associated archetype file, it must be doing something wrong when it parses the path. Hmm…any windows people have similar issues?

OK, I see where goes wrong here. To confirm, could you test:

hugo new post\first.md

This will be fixed in the next release. A current workaround is to use WIn style slashes.

See

Okay this is kinda of ridiculous haha. I tried your suggestion thinking it was sure to be the issue, but it didn’t work.

hugo new post\post.md
hugo new post/post.md

both grabbed the same default.md archetype file. So on a hunch, I tried hugo new post\/post.md and it worked haha.

Yes, that’s some silly escaping going on there, but I see what’s going on. I will fix this.