I don’t think this needs to be in core, but having an official plugin would make it definitely more “trustful”, than a third-party plugin. By providing an official plugin, it would clearly communicate the static site generation is something, that we officially promote/recommend and thus sending a strong signal.
It’s still questionable, how much flexibiliy such a plugin should have. IMHO, static site generation should be triggerable from the panel (section in
site.yml or dedicated view or both. It’s often more comfortable to have such things on you panel’s “dashboard”). And in addition to that, it should also form from the CLI, which is the harder part, because Kirby does not have a unified way of doing CLI stuff (yet).
Exporting to a specified folder should be sufficient, if the plugin provides hooks for post-processing, such as uploading the static files to a different server or similar.
There are some tricky situations, that I also experienced when developing ImageKit for Kirby 2, e.g. if a page sends a redirect header. I’m still not sure, if such a plugin would need to implement a “smart” way of dealing with such situations, or if the docs should advise you not to use redirects,
exit statements etc. in any code that’s needed for generating the static site.