Headless Hugo CMS

I’m a developer, I really like Hugo’s way to help me manage my content with MD on-prem.

And I want to use my content in different way, not just browser, but also native app, smart device, etc.

Is there any plan in Hugo’s roadmap related to those approach?

Thanks

Checked Hugo live road map, I assume there is no priority for Hugo headless CMS, let’s have a try to build it ourself.

2 Likes

You can use the json output of Hugo to get your posts as a JSON object - just like you would from an API.

I believe enableing it like this in your config.toml (of your Hugo project):

[outputFormats.JSON]
mediaType = "application/json"
section = ["HTML", "RSS", "JSON"]
pages = ["HTML", "RSS", "JSON"]
home =  ["HTML", "RSS", "JSON"]

See this article or Hugo Docs for more info.

1 Like

Thanks a lot, that’s really a great idea. I will following this way to read the source code. What I want to try is to make it as a backend server and support client like React/Vue/Svelte for SPA/PWA, which will need some details info, so that I can build HUGO content in other services.

1 Like

Updates:

Related: What is the best Open Source CMS for HUGO?

Thanks for sharing. My goal is not to create another headless CRM or help people to migrate from Hugo. Instead, I aim to extend Hugo’s open-source code and turn it into a hugo native headless CRM, make hugo support static plus dynamic in the future to enrich the ecosystem of this outstanding open-source project.

1 Like

This sounds pretty cool and convenient. Unfortunately, I don’t have enough time at the moment (maybe later this year) to get into these things. So, I’ll have a look from time to time just to follow up. Good luck and happy coding :slight_smile:

Just a quick update. At present, the source code has been sorted out by using DDD (Domain Driven Design), as shown in the domain model diagram below. The whole process took longer than I expected. Hugo is so powerful, with many functions and more details. And I believe that’s why Hugo attracts so many contributors and users. For next step, I will get into API design phase. You can also help with some application scenarios to verify how to abstract the API.

Here is the SVG version for detail info.

One understanding is enough. Reading the Hugo open-source code is quite time-consuming. I’ll continue updating, even at a possibly slower pace. :slight_smile:

Quick update, try to start with this scenarios:

Use Hugo API to build a online book service

It’s been exactly a year since I first posted here in September 2023, and I’m excited to come back with an update! I’m happy to report that I didn’t go back on my word — the proof of concept (PoC) is up and running!

The PoC now supports the following workflow:

  1. Load a Hugo project into the CMS via a command line interface.
  2. Add a new post to the project using an API.
  3. Build the site using an API.
  4. Deploy the site to Netlify via an API.

This is just a simple update as I wanted to share something before the end of September. Next, I’ll be preparing a detailed demo to help introduce the full functionality. Coming soon…

1 Like

Demo is here:

Hugoverse PoC Demo

1 Like

Looks promising. Best wishes.

Thanks