This was driving me crazy on trying to figure out how to fix. I was able to get this working by adding github_host to the html_context {} in conf.py.
The rst__prolog fix was working, but something seemed strange that I couldn't set this in conf.py. It seems you can do the same for bitbucket or gitlab by setting bitbucket_host or gitlab_host the same way.