Extensibility as a headless Hugo CMS

How difficult could be for Hugo to extend its strength via rest API services ;

I hope you understand the common silence in reaction to your post. First of all it’s not very explanatory. From what I understand you want to use a Go-Kart to offer a limousine service.

A REST API requires an authorization system. A static website has nothing like that, except for the server software it is hosted on. A REST API requires some kind of search/filterability. A static website has no dynamic filtering. Both features you can have in connection with Hugo in the form of Netlify Identity Services and Algolia indexing services.

But.

You are trying to abuse a system you love and know and make it into something it is not. It surely is possible to offer a REST API with a Hugo generated website. But like I said… your Go-Kart is an inadequate Limousine. Where is the champaigne?

I could offer a REST API using only Algolia. Why would I try to do it with Hugo, a static (again… static…) Website generator?

It would help if you described the problem you want to solve and what your requirements and goals are.

First sorry for my poor question. I will try to clarify with my not very good english.

What I want is pretty simple in my opinion. Just a server to handle some endpoints, take a look at an example:

/Path Method Description
/content/:section GET List content from section :section
/content/:section POST Create a new content into section :section (also create the section if not exists)
/content/:section/:slug GET Get content :slug from section :section
/content/:section/:slug PUT Update content
/content/:section/:slug DELETE Remove content
/content/:section/:slug/attach POST Add resource to content
/content/:section/:slug/:attach GET Get resource

I think is self explanatory.

Now the questions is how difficult could be for someone who know Golang to just extend the library itself to achieve this.

*I am new to golang and I’ve been working with go for last weeks.

For example hugo core handle all of these stuff:

  • parsing various format of files
  • various functions: e.g.: where .Pages "Section" "foo"
  • pagination
  • search
  • related
  • taxonomies
  • and much more

thank you for your time

Is there any updates?

Why would there be? Hugo is still a static site generator. You can use code to write the API implementation, I guess. But that’s not Hugo’s task.

Thanks for reply. Hugo definitely should focus on it’s motto, I just wondering headless Hugo CMS could be one interesting use case, at least for me. It’s open source, anyway, we can try with ourselves and contribute back the community.