statamic / ssg

The official Statamic Static Site Generator
230 stars 23 forks source link

SSG from the Control Panel as well as SSG specific content, not full site #46

Closed mmltonge closed 2 years ago

mmltonge commented 3 years ago

Hi all,

Firstly apologies if this is the wrong place/method for discussion on a feature for SSG. I've posted to statamic forum too (here) but doesnt look too lively there.

The below stuff makes reference to example repo I've setup here: https://github.com/mmltonge/statamic-ssg

The reason for the above is that I'm currently trying to make the case for statamic at my workplace but to appeal to our clients we need the SSG to work from the UI and to work a bit differently. The features missing were:

  1. Ability to generate to 2 destinations (a preview & live directory)
  2. Ability to generate from the control panel, so that an 'author' could generate content they've made
  3. Ability to generate specific content - so that on a site with thousands of pages (or much less, or much more), you dont need to do a full regen just because you made one new entry.
  4. Ability to generate content from parent down (so everything with a specific collection)

With those needs in mind, I have create an example repo where I've met the needs of 2, 3 and 4 -- and 1 will be pretty straight forward I just haven't done it yet.

The bit that's bugging me -- the way the menu links are generated, ideally only 'SSG Site' would sit in the navigation, and SSG Collection & SSG Entry would be within the section of the page specific to them. So SSG Entry would sit next to Save & Publish, for example. Does anyone have a pointed on how I can add elements into the main areas like that?

Would also be nice to figure out how to stream response of generate() to dashboard, rather than loading a view.

I can also see an obvious issue with timeout for larger generates doing it this way, so would need to handle full site generation by dispatching the normal command I'd assume, rather than running as I have it here.

Ideally this could somehow be made part of the official SSG package, but I'm limited in my knowledge of how this functionality could be added to it properly, rather than as I've done.