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