Deploying your blog¶
Warning
This guide does not cover the deploy using a Git repository, but there are no
big differences. Just use the equivalent git
commands.
Using a WSGI app¶
At this point you should have a Mercurial repository with your blog ready to be deployed.
Copy it to your remote server as usual. e.g. using ssh
:
$ hg clone my_blohg ssh://user@yourdomain.tld/path/to/my_blohg/
Supposing that your Mercurial repository is my_blohg
.
Don’t forget to add the remote path to your local my_blohg/.hg/hgrc
[paths]
section.
The blohg deployment process is similar to any other Flask-powered application. Take a look at the Flask deployment documentation:
http://flask.pocoo.org/docs/deploying/
To create your Flask app
object, use the following code:
from blohg import create_app
application = create_app('/path/to/my_blohg')
There’s a sample blohg.wsgi
file (for Apache mod_wsgi) available here:
https://github.com/rafaelmartins/blohg/blob/master/share/blohg.wsgi
Using static pages¶
You can use the freeze command to generate a static version of your
blog. This will create a build
directory with the content of
your blog as static pages. This way, you can put those pages (via
ftp, rsync, hg, ...) on a static
hosting provider.
-
--serve
¶
This option will serve your generated pages as a local web server. This can be used to check that all links works fine, or that all content has been generated.
-
--noindex
¶
This option will generate your post as html files rather than as directories containing a
index.html
file.
Note
This command uses Frozen-Flask as underlying generator. The
configuration parameters from Frozen-Flask are also efective for
this command, just put them inside blohg’s configuration file. One worth mentionning is FREEZER_BASE_URL
, as
it indicates which base url to put in front of the external links,
like is used for all the attachments.