Massive-Wiki / massivewikibuilder

Massive Wiki Builder
MIT License
3 stars 3 forks source link

Try to always write an index.html file #41

Open peterkaminski opened 1 year ago

peterkaminski commented 1 year ago

If MWB issues an error and halts before it has created an index.html page, it's hard to tell what happened if you're using build automation where you don't necessarily see the script output. (On a Netlify build, for instance; going to a site without an index.html file results in a "Page Not Found" dialog, and it's hard to know where to go from there.)

Therefore, as soon as possible, if it can (i.e., if a valid output directory was specified), MWB should write an index.html file with some diagnostic help, and rewrite it if there was an error.

The first created version might convey something like "Welcome to Massive Wiki Builder. If you're seeing this message, something went wrong; find and check your build logs."

If there's an error, the error should be written; for example:

Can't find template 'search.html'.

Theme or files in theme appear to be missing, or theme argument set incorrectly.

(With appropriate verbiage and help links around the error message.)