# Using Ghost as a headless CMS with Hugo

**URL:** <https://discourse.gohugo.io/t/using-ghost-as-a-headless-cms-with-hugo/23047>\
**Category:** Uncategorized\
**Created:** [January 26, 2020, 2:43pm UTC](https://discourse.gohugo.io/t/using-ghost-as-a-headless-cms-with-hugo/23047 "2020-01-26T14:43:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![voigt](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/voigt/32/10454_2.png) [@voigt](https://discourse.gohugo.io/u/voigt)\
**Post date:** [January 26, 2020, 2:43pm UTC](https://discourse.gohugo.io/t/using-ghost-as-a-headless-cms-with-hugo/23047/1 "2020-01-26T14:43:08Z")

</div>

Hi,

I’m currently trying to figure out the best approach to use Ghost as a headless CMS to render a static page via Hugo.

So far I found [Data Templates](https://gohugo.io/templates/data-templates/), which allow to pull content from a given URL. The following snippet allows me to render a list of all posts:

```auto
<ul>
    {{ $urlPre := "https://<hostname>" }}
    {{ $urlKey := "/?key=<api-key>" }}
    {{ $json := getJSON $urlPre "/ghost/api/v3/content/posts" $urlKey }}

    {{ range $json.posts | first 10 }}
     <li><a href="{{ .url }}" target="_blank">{{ .title }}</a></li>
    {{ end }}
</ul>

```

But what is the best approach to render the actual posts? Is there any chance to “configure” the content of the Hugo Posts? Currently I’m just linking to the Ghost posts, which is not exactly what I intended 😉

Any hints appreciated!

Kind regards,  
Christoph

---

<div class="post-metadata">

**Author:** ![regis](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/regis/32/4958_2.png) [@regis](https://discourse.gohugo.io/u/regis)\
**Post date:** [January 26, 2020, 8:58pm UTC](https://discourse.gohugo.io/t/using-ghost-as-a-headless-cms-with-hugo/23047/2 "2020-01-26T20:58:58Z")

</div>

It’s coming: [https://github.com/gohugoio/hugo/issues/6310](https://github.com/gohugoio/hugo/issues/6310) 🙂

---

<div class="post-metadata">

**Author:** ![voigt](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/voigt/32/10454_2.png) [@voigt](https://discourse.gohugo.io/u/voigt)\
**Post date:** [January 29, 2020, 8:27am UTC](https://discourse.gohugo.io/t/using-ghost-as-a-headless-cms-with-hugo/23047/3 "2020-01-29T08:27:30Z")

</div>

Thats good news, thank you!  
Though I hoped it is already possible - reading about all the “JAM”-Buzz lead me to this assumption^^’

---

<div class="post-metadata">

**Author:** ![M4rt1n](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/m4rt1n/32/14245_2.png) [@M4rt1n](https://discourse.gohugo.io/u/M4rt1n)\
**Post date:** [October 11, 2021, 1:10pm UTC](https://discourse.gohugo.io/t/using-ghost-as-a-headless-cms-with-hugo/23047/4 "2021-10-11T13:10:19Z")

</div>

Are there any news on this and any examples on how to set up Ghost as a headless CMS for HUGO?

Thanks!

---

<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:** [October 11, 2021, 3:57pm UTC](https://discourse.gohugo.io/t/using-ghost-as-a-headless-cms-with-hugo/23047/5 "2021-10-11T15:57:47Z")

</div>

There are no news.

Hugo still does not support generating content pages from data.

With that said if Ghost gives you the option to output content as a JSON array then the simplest way that I know would be to use [JQ](https://stedolan.github.io/jq/) to split it into multiple markdown files. You can keep the JSON format within the generated files as it will be their front matter.

[A single JSON object surrounded by ‘ `{` ’ and ‘ `}` ’, followed by a new line](https://gohugo.io/content-management/front-matter#front-matter-formats) is acceptable front matter format by Hugo.

There have also been other techniques posted in the forum regarding splitting a JSON into pages.

Also I’m archiving this old topic. I suggest that you track the GitHub issue that was posted above for future developments or if you want to discuss this feature further then please open a new forum topic. Perhaps others have other techniques to share.

---

<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:** [October 11, 2021, 3:57pm UTC](https://discourse.gohugo.io/t/using-ghost-as-a-headless-cms-with-hugo/23047/6 "2021-10-11T15:57:57Z")

</div>

Archived on October 11, 2021, 3:57pm UTC


