Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
211 views
in Plugins by
I need to focus on less projects. This is why I want to get rid of maintaining some small projects. They cost time and I do not want to do updates etc. My idea is to provide all pages of the q2a installations as static HTML. Keeping the content, but not the q2a software and the database.

The Modx Evolution had such an option, as I remember.

What would be the best approach to take a Q2A site to static HTML posts?
Q2A version: 1.7.4

2 Answers

0 votes
by
It may not be possible easily but if you use v1.8 then enable cache which will help to reduce db access for frequently accessed content.
by
As I said, I want to get rid of maintenance, which means for me: No DB, no PHP files.
by
You mentioned MODX, so you mean to export your site to HTML, thereby closing out all Q2A-specific functionality? It will just be all the questions and answers and comments in a rendered static HTML?
by
Exactly. Static HTML only. // Side info: I maintain 4 tiny projects, they cost me about 20 hours per month. I receive ads revenue of about 5 USD. I need to "static-achieve" them because my 20 hours have a higher value than 5 USD.
by
I think this is the way to go: https://stackoverflow.com/q/3775281/1066234
by
Yea, that might work. If your site is smalllllish. Or you modify the script to crawl the entire site. Or you just click every post/question on the q2a site, so that html can be saved.
Since this is not webdev-specific, I'd  use https://www.httrack.com/
It has served me too many times.
+3 votes
by
edited by

Plugin Solution

Found a way to get ALL pages at once into ONE page: https://github.com/NoahY/q2a-book BUT I must check the code again, it only takes 100 out of 560 questions in my test, "only hottest", so does not include all posts.

Update: I need to modify the q2a-book plugin because it only displays questions with answers. Here is the fork with the implemented changes: https://github.com/q2apro/q2a-book

Note: I am sure that this "solution" is mostly for small sites. If you have 100k posts you might run into memory issues.

Software Solution

Another way is to use a downloader software: https://www.httrack.com and then upload the HTML files to the server.

Any other option? Post it as a comment :)

by
If you want an "archived" site i.e. no updates in the future, then httrack is what I would use.
Only problem is you'll need to remove all links for login, register, answering, commenting and so on.
...