Site-user created content from front-end via forms?

Given this comment from Hugo Server for Production:

My mind’s been going a bit (too?) wild. I hadn’t previously thought of Hugo being used for production on the server… I suppose simply because I’d always thought of it as a (mere) static site generator). Using it for production, even if it’s a separate “product” of sorts (as you say here, @bjornerik), opens up the use of Hugo to server-side scripting (however basic or advanced one might want to make it). Is this correct? And if so, are there any folks doing this who’d care to share some use-cases/code?

Recently I’ve begun diving into Statamic which has a seemingly simple yet surprisingly powerful feature: Creating site-user content via form submissions (via their form add-on, Raven).

Why can’t we do the same with Hugo?

Feature Idea/Request: Allow users of a Hugo site to create content from a site’s front-end via forms, writing the content to a file.

And for the curious, I’m becoming a bit fixed on this idea of trying to find something between a purely static site generator/flat-file-cms and full-blown database (yikes!) solution for web “apps/sites/whatever-it-is-we-want/need-to-create-these-days”. This lead me to this post on Statamic’s blog, Using Statamic for Web Apps. Naturally, I’m not really happy with a PHP solution… why not build the features for such in Hugo?

Related and helpful threads here on the Hugo Formum:

PS: Combining the above proposed feature with a basic user feature (front-end user accounts) and running Hugo in watch mode on a production server seems like it could do some pretty powerful stuff.

PPS: If I was a Gopher (working on it, but not there yet) I’d be writing code right now instead of this post. Just sayin’. I might still start (trying) to write some Go code related to this, but seems a better use of my time to try and get others (with actual Go-chops) excited about the potential of such features.

It’s definitely the case that Hugo could serve as more than just a SSG. In reality Hugo is really a website framework, which is why in the docs it’s usually refered to as a static site system. All the pieces are in place for this to happen and it wouldn’t be very hard to extend it to be more. This leads us to two things:

  1. Any user can extend hugo to fit their individual needs.
  2. What features should hugo add (if any) in this regard.

It’s also the case that these features (while compiled in) can be 100% optional and configurable.

1 Like

Three core ones come to mind (for my use cases):

  1. user accounts
  2. routing
  3. form handling