Merge pull request #908 from realpython/new-hosting

New hosting
This commit is contained in:
Dan Bader
2018-07-16 17:12:25 -07:00
committed by GitHub
10 changed files with 71 additions and 17 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ How to contribute
This guide is under heavy development. If you would like to contribute, please
see:
http://docs.python-guide.org/en/latest/notes/contribute/
https://docs.python-guide.org/notes/contribute/
How to test your changes
------------------------
@@ -34,4 +34,4 @@ Style Guide
For all contributions, please follow the `Guide Style Guide`:
http://docs.python-guide.org/en/latest/notes/styleguide/
https://docs.python-guide.org/notes/styleguide/
+1 -1
View File
@@ -33,4 +33,4 @@ Topics include:
If you aren't fond of reading reStructuredText, there is an
almost up-to-date `HTML version at docs.python-guide.org
<http://docs.python-guide.org>`_.
<https://docs.python-guide.org>`_.
+2 -2
View File
@@ -8,9 +8,9 @@ It looks like this was the result of either:
- a mistyped address
- an out-of-date link
`Click here to go back to the homepage. <http://docs.python-guide.org/>`_
`Click here to go back to the homepage. <https://docs.python-guide.org/>`_
Or, try `searching <http://docs.python-guide.org/en/latest/search/>`_.
Or, try `searching <https://docs.python-guide.org/search/>`_.
.. raw:: html
+6
View File
@@ -59,6 +59,12 @@ dirhtml:
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
netlify: dirhtml
@cp $(BUILDDIR)/dirhtml/404/index.html $(BUILDDIR)/dirhtml/404.html
@sed -i -e 's/src="..\//src="\//g' $(BUILDDIR)/dirhtml/404.html
@sed -i -e 's/href="..\//href="\//g' $(BUILDDIR)/dirhtml/404.html
@cp _extra/* $(BUILDDIR)/dirhtml/
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
+16
View File
@@ -0,0 +1,16 @@
# Redirect rules
# Docs: https://www.netlify.com/docs/redirects/
# Redirect http to https (avoid one extra hop with an explicit rule for /en/latest/)
http://docs.python-guide.org/en/latest/* https://docs.python-guide.org/:splat 301!
http://docs.python-guide.org/* https://docs.python-guide.org/:splat 301!
# Redirect RTD prefix to /
/en/latest/* /:splat 301!
# Redirect domain aliases to primary domain
http://python-guide.org/* http://docs.python-guide.org/:splat 301!
https://python-guide.org/* https://docs.python-guide.org/:splat 301!
# Redirect Netlify version to primary domain
https://python-guide.netlify.com/* https://docs.python-guide.org/:splat 301!
+34 -1
View File
@@ -1,6 +1,39 @@
{% extends "!layout.html" %}
{%- block extrahead %}
{{ super() }}
{# No super() because we want to avoid loading an empty custom.css file #}
{# <meta name="viewport" content="width=device-width, initial-scale=0.75, maximum-scale=0.75" /> #}
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
div.body {
min-width: initial;
max-width: initial;
}
</style>
{% if pagename == 'index' %}
<link rel="canonical" href="https://docs.python-guide.org/"/>
{% elif pagename == '404' %}
{# No canonical on our 404 template. #}
{% else %}
<link rel="canonical" href="https://docs.python-guide.org/{{ pagename }}/"/>
{% endif %}
<link rel="icon" type="image/png" href="https://media.readthedocs.org/images/favicon.png">
<meta name="google-site-verification" content="013PxE2_8KX9jdUSC5gr8QsfdxTXr1mFgmD9zplp5II" />
{# Alabaster theme native GA integration is outdated (ga.js). #}
{# Insert our own GA snippet instead. #}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-37242602-11', 'auto');
ga('send', 'pageview');
</script>
{% endblock %}
+6 -7
View File
@@ -13,8 +13,7 @@
<h3>Stay Informed</h3>
<p>Receive updates on new releases and upcoming projects.</p>
<p><iframe src="http://ghbtns.com/github-btn.html?user=kennethreitz&type=follow&count=false"
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="20"></iframe></p>
<p><iframe src="https://ghbtns.com/github-btn.html?user=kennethreitz&type=follow&count=false" allowtransparency="true" frameborder="0" scrolling="0" width="200" height="20"></iframe></p>
<p><a href="https://twitter.com/kennethreitz" class="twitter-follow-button" data-show-count="false">Follow @kennethreitz</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></p>
@@ -51,21 +50,21 @@
This guide is the result of the collaboration of
<a href="https://github.com/kennethreitz/python-guide/graphs/contributors">hundreds of people</a>
around the world, and your contributions
<a href="http://docs.python-guide.org/en/latest/notes/contribute/">are welcome</a>!
<a href="https://docs.python-guide.org/notes/contribute/">are welcome</a>!
</p>
<h3>Useful Links</h3>
<ul>
<li><a href="http://python-guide.org/">The Guide Website</a></li>
<li><a href="http://github.com/kennethreitz/python-guide">The Guide @ GitHub</a></li>
<li><a href="http://github.com/kennethreitz/python-guide/issues">Issue Tracker</a></li>
<li><a href="https://docs.python-guide.org/">The Guide Website</a></li>
<li><a href="http://github.com/realpython/python-guide">The Guide @ GitHub</a></li>
<li><a href="http://github.com/realpython/python-guide/issues">Issue Tracker</a></li>
<li><a href="https://media.readthedocs.org/pdf/python-guide/latest/python-guide.pdf">The Guide as a PDF</a></li>
</ul>
<h3>Translations</h3>
<ul>
<li><a href="http://docs.python-guide.org/en/latest/">English</a></li>
<li><a href="https://docs.python-guide.org/">English</a></li>
<li><a href="https://python-guide-fr.readthedocs.io/fr/latest/">French</a></li>
<li><a href="https://pythonguidecn.readthedocs.io/zh/latest/">Chinese</a></li>
<li><a href="http://python-guideja.readthedocs.io/ja/latest/">Japanese</a></li>
+2 -3
View File
@@ -13,8 +13,7 @@
<h3>Get Updates</h3>
<p>Receive updates on new releases and upcoming projects.</p>
<p><iframe src="http://ghbtns.com/github-btn.html?user=kennethreitz&type=follow&count=false"
allowtransparency="true" frameborder="0" scrolling="0" width="200" height="20"></iframe></p>
<p><iframe src="https://ghbtns.com/github-btn.html?user=kennethreitz&type=follow&count=false" allowtransparency="true" frameborder="0" scrolling="0" width="200" height="20"></iframe></p>
<p><a href="https://twitter.com/kennethreitz" class="twitter-follow-button" data-show-count="false">Follow @kennethreitz</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></p>
<p><a href="https://saythanks.io/to/kennethreitz">Say Thanks!</a></p>
@@ -49,7 +48,7 @@
<h3>Translations</h3>
<ul>
<li><a href="http://docs.python-guide.org/en/latest/">English</a></li>
<li><a href="https://docs.python-guide.org/">English</a></li>
<li><a href="https://python-guide-fr.readthedocs.io/fr/latest/">French</a></li>
<li><a href="https://pythonguidecn.readthedocs.io/zh/latest/">Chinese</a></li>
<li><a href="http://python-guideja.readthedocs.io/ja/latest/">Japanese</a></li>
+1 -1
View File
@@ -62,7 +62,7 @@ using your OS package manager, you may have to `install pip <https://pip.pypa.io
.. _python.org: https://python.org
.. _pip: https://pypi.org/project/pip/
.. _Homebrew: https://brew.sh
.. _Installing Python: http://docs.python-guide.org/en/latest/starting/installation/
.. _Installing Python: https://docs.python-guide.org/starting/installation/
Installing Pipenv
+1
View File
@@ -0,0 +1 @@
3.6