~ubuntu-za-dev/ubuntu-za/website

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Getting Started
===============

The Ubuntu-ZA site is a static HTML site generated by the `Nikola <http://getnikola.com/>`_ site generator. Nikola is
written in Python and is in the Ubuntu repository.


Installing Nikola (Ubuntu 14.10 and higher)
-------------------------------------------
The minimum version of Nikola required is 7.0. If you're running Ubuntu 14.10 Utopic Unicorn, you'll have 7.0.1 in the
repositories and you can just install it using apt-get::

    $ sudo apt-get install nikola


Installing Nikola (Ubuntu 14.04 and lower)
-------------------------------------------
If you're on an earlier version of Ubuntu, you'll need to install the latest version of Nikola. The best way to do this
is to create a virtual environment and install it in there.

First, install ``python-virtualenv`` and a number of other packages you will need::

    $ sudo apt-get install python-virtualenv python-dev libxml2-dev libxslt1-dev zlib1g-dev

Then you need to create a virtual environment. Navigate to a root folder for your virtual environment, and then create
your virtual environment::

    $ cd ~/Projects
    $ virtualenv --system-site-packages venv

Once that is done, you need to install Nikola itself::

    $ ./venv/bin/pip install --upgrade nikola

You may want to create a symlink for ease-of-use::

    $ ln -s /path/to/venv/bin/nikola /path/to/ubuntuza-site/nikola


Building the Site
-----------------
Once you have Nikola installed, you probably want to see the site. First we need to build it::

    $ nikola build

If you've created the symlink, you'll want to use it like this::

    $ ./nikola build


Running the Site
----------------
To preview the site, it's as easy as running a local web server::

    $ nikola serve

Then open your browser and naviate to `http://127.0.0.1:8000/`_ to see the site.