# Archetype rework in 0.89(.0/2/3) breaks hugo new

**URL:** <https://discourse.gohugo.io/t/archetype-rework-in-0-89-0-2-3-breaks-hugo-new/35610>\
**Category:** support\
**Created:** [November 16, 2021, 2:20pm UTC](https://discourse.gohugo.io/t/archetype-rework-in-0-89-0-2-3-breaks-hugo-new/35610 "2021-11-16T14:20:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [November 16, 2021, 2:20pm UTC](https://discourse.gohugo.io/t/archetype-rework-in-0-89-0-2-3-breaks-hugo-new/35610/1 "2021-11-16T14:20:56Z")

</div>

Since the archetype rework in 0.89 my `hugo new` throws (various differing) errors.

The archetype (in archetypes/blog/index.md):

```auto
+++
title = "{{ replace .Name "-" " " | title }}"
linkTitle = "{{ replace .Name "-" " " | title }}"
# used for SEO description, should not go over 180 characters
description = ""
# used for the preview of the post on list pages
# if missing or empty the automatic excerpt is used
summary = ""

# dates
date = {{ .Date }}
publishDate = {{ .Date }}
lastmod = {{ .Date }}

# add multiple resources to create a slider gallery
[[resources]]
title = "Photo by [Ave Calvar](https://unsplash.com/@shotbyrain) via [Unsplash](https://unsplash.com/s/photos/horizon)"
name = "image name if other than src"
src = "ave-calvar-HcUDHJfd5GY-unsplash.jpg"

# remove the author section to use the sites author setup
[author]
name = "Patrick Kollitsch"
homepage = "https://kollitsch.de/"
image = "/images/patrick-kollitsch.jpg"
email = "patrick@kollitsch.de"

# taxonomification
categories = [
  "category1"
]
tags = [
  "tag1", 
  "tag2"
]
keywords = [
  "keyword1", 
  "keyword2"
]
+++

```

with GoHugo 0.89.0:

```auto
patrick@main:~/Projects/dnb-org/kollitsch.de$ hugo new blog/2021/hyper-shell
Error: mkdir /tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/dnb-org/libraries/heroicons@v1.0.3/content/blog: permission denied

```

(note, that GoHugo tries to create the post inside of a module-cache)

with GoHugo 0.89.2:

```auto
patrick@main:~/Projects/dnb-org/kollitsch.de$ hugo new blog/2021/hyper-shell
Error: open : no such file or directory

```

with GoHugo 0.89.3:

```auto
patrick@main:~/Projects/dnb-org/kollitsch.de$ hugo new blog/2021/hyper-shell
Error: could not determine content directory for "blog/2021/hyper-shell"

```

downgrading to GoHugo 0.88.1 solves the issue and the post is created.

```auto
patrick@main:~/Projects/dnb-org/kollitsch.de$ hugo new blog/2021/hyper-shell
/home/patrick/Projects/dnb-org/kollitsch.de/content/blog/2021/hyper-shell created

```

[The repo is public](https://github.com/davidsneighbour/kollitsch.de) in case anybody wants to try their luck.

---

<div class="post-metadata">

**Author:** ![cshoredaniel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cshoredaniel/32/19684_2.png) [@cshoredaniel](https://discourse.gohugo.io/u/cshoredaniel)\
**Post date:** [November 16, 2021, 5:49pm UTC](https://discourse.gohugo.io/t/archetype-rework-in-0-89-0-2-3-breaks-hugo-new/35610/2 "2021-11-16T17:49:08Z")

</div>

Once I figured out you were using things like `archetypes/default/index.md` instead of `archetypes/default.md` I tried:

```bash
hugo new /blog/2021/hyper-shell/index.md

```

and got

```plaintext
WARN 2021/11/16 12:44:34 Module "github.com/dnb-org/components/functions" is not compatible with this Hugo version; run "hugo mod graph" for more information.
WARN 2021/11/16 12:44:34 Module "github.com/dnb-org/components/giscus" is not compatible with this Hugo version; run "hugo mod graph" for more information.
WARN 2021/11/16 12:44:34 Module "github.com/dnb-org/components/netlification" is not compatible with this Hugo version; run "hugo mod graph" for more information.
WARN 2021/11/16 12:44:34 Module "github.com/dnb-org/shortcodes/collection" is not compatible with this Hugo version; run "hugo mod graph" for more information.
WARN 2021/11/16 12:44:34 Module "github.com/dnb-org/shortcodes/youtube" is not compatible with this Hugo version; run "hugo mod graph" for more information.
WARN 2021/11/16 12:44:34 Module "github.com/dnb-org/shortcodes/pictures" is not compatible with this Hugo version; run "hugo mod graph" for more information.
Error: from config: failed to resolve output format "security" from site config

```

It looks to me like the use of directories for config and archetypes is confusing the new archetype code.

Oh, hugo version: `hugo v0.89.3-C88CDB56 linux/amd64 BuildDate=2021-11-15T12:17:46Z VendorInfo=gohugoio`

Scratch that; it’s occurring for me independent of use of directories for archetypes and config. (But haven’t yet got a public repo to show).

EDIT:

With my repo at

[https://github.com/danielfdickinson/hugo-mounted-content-subdir-bug-0-89.git](https://github.com/danielfdickinson/hugo-mounted-content-subdir-bug-0-89.git)

and rm -rf archetypes (so that it uses the theme archetypes):

I get the same error as

> [@New problem creating new pages with hugo new](https://discourse.gohugo.io/t/new-problem-creating-new-pages-with-hugo-new/35573/8):
>
> My issue appears to be the same as that documented at 89.3 changed the error message from Error: open : no such file or directory to Error: could not determine content directory for … Not seeking further de-bugging assistance on this, with a couple work-arounds having been suggested, including downgrading to 88.x. Just flagging that a new failure appeared in 89.x across my different computers and Hugo sites, without my having changed their configuration. That suggests to me that something…

Which is to say it works if I first do `hugo mod vendor`, but if I don’t I get:

```bash
hugo new content/test-docs/test2.md

```

```plaintext
hugo: collected modules in 1696 ms
Error: could not determine content directory for "content/test-docs/test2.md"

```

OR

```bash
hugo new test-docs/test2.md

```

```plaintext
Error: could not determine content directory for "test-docs/test2.md"

```

EDIT: I wonder if Go has changed something that affects the vfs?

@bep What is the best way to capture the info for an issue report on GitHub?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [November 16, 2021, 6:39pm UTC](https://discourse.gohugo.io/t/archetype-rework-in-0-89-0-2-3-breaks-hugo-new/35610/3 "2021-11-16T18:39:11Z")

</div>

> [@davidsneighbour](#):
>
> ` hugo new blog/2021/hyper-shell`

> <https://github.com/gohugoio/hugo/issues/9177>
>
> Or something. Not sure, because this has been tested OK on several module projec…ts, but I at least have a failing test case.

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [November 17, 2021, 11:13am UTC](https://discourse.gohugo.io/t/archetype-rework-in-0-89-0-2-3-breaks-hugo-new/35610/4 "2021-11-17T11:13:11Z")

</div>

The issue was fixed with the release of:

> **[Release v0.89.4 · gohugoio/hugo](https://github.com/gohugoio/hugo/releases/tag/v0.89.4)**
>
> This is a bug-fix release with one important fix for people using hugo new to create new content:
> 
> Fix content dir resolution when main project is a Hugo Module 2e70f61f @bep #9177

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [November 19, 2021, 11:13am UTC](https://discourse.gohugo.io/t/archetype-rework-in-0-89-0-2-3-breaks-hugo-new/35610/5 "2021-11-19T11:13:12Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
