See if sphinx-doc[1] suits your needs. http://d2l.ai is a good example of an online book done using Sphinx. Supports discussions through Discourse integration.
You write content using reST or Markdown (HTML is also possible). Sphinx generates a static site. JavaScript can be used for dynamic content integration. Supports built-in keyword search using only JS. A theme like mxtheme makes it look good too.
Another option is Jekyll. Similar thing, except that Sphinx requires Python while Jekyll requires Ruby. https://course.fast.ai is a good example.
mdBook [1] is an option if you want to convert markdown to a static website. There's plenty of customization options but I don't know if it is possible or easy enough to add comments.
Or just publish it on GitHub? There's a discussions feature but I don't think it is out of beta yet. Until then you could use issues for discussions. Or reddit may be?
Yes, but my understanding is that the final product is "static", meaning that there is no way for readers to contribute to the book or comment on sections of the book.
You write content using reST or Markdown (HTML is also possible). Sphinx generates a static site. JavaScript can be used for dynamic content integration. Supports built-in keyword search using only JS. A theme like mxtheme makes it look good too.
Another option is Jekyll. Similar thing, except that Sphinx requires Python while Jekyll requires Ruby. https://course.fast.ai is a good example.
[1] : https://www.sphinx-doc.org/en/master/