FransBouma / DocNet

Your friendly static documentation generator, using markdown files to build the content.
http://fransbouma.github.io/DocNet/
248 stars 36 forks source link

Generate 404 page #62

Closed GeertvanHorrik closed 7 years ago

GeertvanHorrik commented 7 years ago

Sometimes you get a 404 page. It would be nice if we could generate a 404 page (including ToC).

GeertvanHorrik commented 7 years ago

At first I thought I could get passed this by forcing a 404.md, but then it gets added to the ToC. I think we an support a 404.md in the root which will automatically be generated as well.

FransBouma commented 7 years ago

Ok, tho 404's are only supported by a webserver. Docs are also meant to be read off-line. A dedicated option in the docnet.json file with a reference to the 404.md might work though. All that's needed is generate a 404.htm in the root, the machinery is there, it's indeed not to be added to the ToC, which might need some extra code.

Another option is to simply use a boolean flag in the docnet.json: 'generate 404 page', which will emit a htm file with the toc like with any other file, but with predefined content (like the generated index pages): "404 Page not found".

The 404.md option is more flexible tho.

GeertvanHorrik commented 7 years ago

Once the other PR is accepted, I will go for the option you've described (default true I assume)?

GeertvanHorrik commented 7 years ago

image