# Hugo convert to json not working

**URL:** <https://discourse.gohugo.io/t/hugo-convert-to-json-not-working/9164>\
**Category:** support\
**Created:** [November 9, 2017, 2:20am UTC](https://discourse.gohugo.io/t/hugo-convert-to-json-not-working/9164 "2017-11-09T02:20:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajesh\_Kumar\_Singh](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@Rajesh\_Kumar\_Singh](https://discourse.gohugo.io/u/Rajesh_Kumar_Singh)\
**Post date:** [November 9, 2017, 2:20am UTC](https://discourse.gohugo.io/t/hugo-convert-to-json-not-working/9164/1 "2017-11-09T02:20:48Z")

</div>

Hi,

Hugo provides a command convert to json [http://www.gohugo.org/doc/commands/hugo\_convert\_tojson/](http://www.gohugo.org/doc/commands/hugo_convert_tojson/)

Its not working for me. as per my understanding it should convert all the mark down files which are present in the content folder to josn format.

but when i am running this command its throwing error.

Failed to set source metadata for file “/Applications/MAMP/htdocs/hugo/quickstart/content/abc.md”: json: unsupported type: map[interface {}]interface {}. For more info see For more info see [https://github.com/gohugoio/hugo/issues/2458](https://github.com/gohugoio/hugo/issues/2458)

We are stuck here. Please suggest!

---

<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 9, 2017, 8:49am UTC](https://discourse.gohugo.io/t/hugo-convert-to-json-not-working/9164/2 "2017-11-09T08:49:34Z")

</div>

See [https://github.com/gohugoio/hugo/issues/2441](https://github.com/gohugoio/hugo/issues/2441)

---

<div class="post-metadata">

**Author:** ![Rajesh\_Kumar\_Singh](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@Rajesh\_Kumar\_Singh](https://discourse.gohugo.io/u/Rajesh_Kumar_Singh)\
**Post date:** [November 9, 2017, 9:11am UTC](https://discourse.gohugo.io/t/hugo-convert-to-json-not-working/9164/3 "2017-11-09T09:11:09Z")

</div>

Thanks Bep for your reply. I am able to convert to json now

The only issue which i am facing right now is that when i run the command hugo convert toJSON --output “static” its creating the json of the markdown files which are present in content directory but storing the relative path in static folder

So for example if my hugo resides ( the relative path of content folder ) in /var/www/html/hugo/quickstart/content and i run the command to convert to json the structure which is getting prepared in static folder is /static/var/www/html/hugo/quickstart/content/about.md ( assuming [about.md](http://about.md) is present in the contetns folder)

what i want is [about.md](http://about.md) which contains the json whuld be in static/ folder insted of all the relative path.

I did not found any tutorial or setting for changing this. Kindly suggest!
