HelloZeroNet / Documentation

ZeroNet Documentation
https://zeronet.readthedocs.org/
GNU General Public License v2.0
74 stars 107 forks source link

Move documentation off of readthedocs #101

Closed anoadragon453 closed 5 years ago

anoadragon453 commented 5 years ago

Continuation of #95

Essentially you'll want to set up a webhook for whenever master is pushed to. This will then send out a notification, which a program like https://github.com/OllieJones/git-webhook-responder/blob/master/README.md can respond to and run a command, like mkdocs build, on.

It's not too difficult to set up and self-host. We'll also need to provide a redirect from the existing documentation URLs to the new ones. My suggestion is just replacing each page with some text that says "The documentation has moved to docs.zeronet.io. You will be redirected in 5 seconds, otherwise click [here]()".

And then we have some JS that will take them to the exact docs page they wanted to go to, but now on the new domain.

I'm fine with writing the JS and getting that working if you're ok with doing the hosting part @HelloZeroNet?

HelloZeroNet commented 5 years ago

Yeah I will setup the hosting. I think we should do the redirect part in js, so we don't need to replace every page.

anoadragon453 commented 5 years ago

Yeah that sounds good. I'll see what I can do.

HelloZeroNet commented 5 years ago

First try: https://zeronet.io/docs/ Looks like the menu order is got fixed

anoadragon453 commented 5 years ago

Wonderful! Have you set up the webhooks yet? Also do you want to try to mkdocs-material theme yet?

anoadragon453 commented 5 years ago

Alright, for the JS I'm thinking of popping up a notice that says it'll take you to the new docs page. It'll then check if the same page exists on the new docs (in case we moved a page or changed its name). If a 404 is returned, it'll just take you to https://zeronet.io/docs.

Sound good?

HelloZeroNet commented 5 years ago

Sounds good for me, tomrrow I will setup the mkdocs-material theme

anoadragon453 commented 5 years ago

JS is ready, but could you enable CORS for https://zeronet.io/docs so I can check if a given page returns a 404 or not?

https://enable-cors.org

HelloZeroNet commented 5 years ago

have added the webhooks + allowed cors, but seems like github does not really works well today, problem with PR mergning and webhooks does not seems to trigger

Other issues

anoadragon453 commented 5 years ago

@HelloZeroNet Yeah it's broken for everyone.

Regarding the images, they seem to be linking to https://zeronet.io/img/zerotalk.png instead of https://zeronet.io/docs/img/zerotalk.png. I imagine this is the problem. I suppose this is the issue of using https://zeronet.io/docs/... instead of https://docs.zeronet.io/

We could either change the documentation (which would require everyone rehosting to start their URLs with /docs/), or you could put in a URL rewrite rule into nginx like so:

// Inside your server {} block...
location /docs/ {
    rewrite ^/img/(.*)$ /docs/img/$1 last;
}
HelloZeroNet commented 5 years ago

Fixed the images by using relative pats

anoadragon453 commented 5 years ago

Heh, that works too.

anoadragon453 commented 5 years ago

There are some great extensions we should look at enabling mentioned here, btw: https://squidfunk.github.io/mkdocs-material/extensions/codehilite/

anoadragon453 commented 5 years ago

I think we can safely close this one now :)