# Can I create a json archetype for data?

**URL:** <https://discourse.gohugo.io/t/can-i-create-a-json-archetype-for-data/19372>\
**Category:** support\
**Created:** [June 26, 2019, 6:24pm UTC](https://discourse.gohugo.io/t/can-i-create-a-json-archetype-for-data/19372 "2019-06-26T18:24:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![i73](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/i73/32/9010_2.png) [@i73](https://discourse.gohugo.io/u/i73)\
**Post date:** [June 26, 2019, 6:24pm UTC](https://discourse.gohugo.io/t/can-i-create-a-json-archetype-for-data/19372/1 "2019-06-26T18:24:14Z")

</div>

This is my first time creating a static site and I love how it takes a lot of the scripting work of serving up content how it does, but I have to generate a bunch of items for a store and wondering if I can do something similar to content archetypes but with json? Like this: `hugo new item/item.mb`

If this is not possible I can write my own build script that reads in a data file.

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [June 26, 2019, 7:44pm UTC](https://discourse.gohugo.io/t/can-i-create-a-json-archetype-for-data/19372/2 "2019-06-26T19:44:24Z")

</div>

> [@i73](#):
>
> but I have to generate a bunch of items for a store and wondering if I can do something similar to content archetypes but with json? Like this: `hugo new item/item.mb`

I don’t think archetypes can write to the data directory, but there are all kinds of way to read in data or generate data from page bundles. I suggest reading all the docs to get a sense of what is possible.

---

<div class="post-metadata">

**Author:** ![i73](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/i73/32/9010_2.png) [@i73](https://discourse.gohugo.io/u/i73)\
**Post date:** [June 26, 2019, 7:53pm UTC](https://discourse.gohugo.io/t/can-i-create-a-json-archetype-for-data/19372/3 "2019-06-26T19:53:18Z")

</div>

I’ve read the docs and there seems to be nothing on this subject.

---

<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:** [June 26, 2019, 8:32pm UTC](https://discourse.gohugo.io/t/can-i-create-a-json-archetype-for-data/19372/4 "2019-06-26T20:32:37Z")

</div>

In short, you can use complete directories as archetype templates – which is great if you want to create bundles (see [https://github.com/gohugoio/hugoDocs/tree/master/archetypes/showcase](https://github.com/gohugoio/hugoDocs/tree/master/archetypes/showcase) for an example).

You can currently only have template syntax inside content files in a archetype template dirs, the other files are just copied. But note that you can put just about anything in the front matter of a content page, so that may be an option. Also see a recent discussion about `transform.Unmarshal`.
