tinkerer / blog / doc / deploying.rst


Tinkerer generates a static website under blog/html. The files can be uploaded anywhere. An option is to host your blog on Bitbucket.

Hosting on Bitbucket

Create a repository named $(USERNAME) where $(USERNAME) is your Bitbucket username, for example If you create such a repository, when accessing, Bitbucket will automatically serve the index.html found under the root of the repository. The repository name must include, so in the example above the actual repository URL would be

You have two options:

Upload HTML only

Commit the content of your blog's blog/html directory to the repository. The index.html file generated by Tinkerer is the front page of your blog.


Make sure to update the website variable in to so the RSS feed can properly link your posts.

Upload both HTML and sources

Commit your whole blog to the repository, including files in the root directory and source. Tinkerer generates an index.html file in the blog's root which redirects to blog/html/index.html to enable this scenario.


Make sure to update the website variable in to so the RSS feed can properly link your posts. Note the trailing blog/html - the website variable must point to the root of your blog's build directory, not root directory.

Copying extra files to the html output directory

Files placed in an folder named _copy will be automatically copied to the html output directory.

This could be useful for an .htaccess file, an robots.txt file or an extra favicon.ico etc.

Creating custom 404 and 403 error pages

If your webserver supports .htaccess files you can create these pages by placing an .htaccess file under _copy/.htaccess with the following content:

ErrorDocument 404
ErrorDocument 403
Options -Indexes

Add an file 404.rst to the document root:

The URL you requested was not found.

.. comments::

Your own text.

Add an file 403.rst to the document root:

403 Permission Denied

.. comments::

Your own text.

And add these two pages to the master.rst file:


.. toctree::


.. toctree::
  :maxdepth: 1


Adding custom analytics code

If you don't want to use Google Analytics and for example Piwik you can add custom JavaScript code by placing an file named page.html under _templates/page.html:

{% extends "!page.html" %}

{% block footer %}
    {{ super() }}
    {% include "../_static/piwik.js" %}
{% endblock %}

And the analytics code inside _static/piwik.js:

<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "" : "");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
} catch( err ) {}
</script><noscript><p><img src="" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->

Back to :ref:`tinkerer_reference`.