antorenge / nairobilug.or.ke

Nairobi GNU/Linux Users Group website

Home Page:nairobilug.or.ke

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nairobi GNU/Linux Users Group blog

This is the repository which hosts the code for the Nairobi GNU/Linux Users Group blog. We wanted a fun, nerdy and democratic way to give our community an online presence, so here we are.

Wanna build it?

In order to build this, you need to have Pelican installed. The easiest way to do this is to use Python virtual environments; virtualenv will work, but it's recommended to use virtualenv-wrapper (a set of extensions to virtualenv).

For reference, a list of commonly-used distro package names is:

If your distro isn't listed, you'll have to do a bit of homework (and then make a pull request to fix these docs).

Create a virtualenv

Once you have virtualenv-wrapper installed, create a virtual environment to hold Pelican and its dependencies:

mkvirtualenv -p `which python2` nairobilug
workon nairobilug

This creates a virtual environment where Python is explicitly set to version 2, and then activates it. If you want to exit the virtual environment, you just type deactivate.

Install Pelican and friends

Use pip to install the list of dependencies into your virtual environment:

pip install -r https://raw.github.com/nairobilug/nairobilug.or.ke/master/requirements.txt

Preparations

The theme we're using, crowsfoot, is a "git submodule", which means it is maintained as its own separate git repository (with its own git history, github project, etc). submodules are stored in the .gitmodules file, and we first need to initialize and clone it before we can build.

Navigate to where you cloned the repo and then:

git submodule init
git submodule update

You only need to do the initialization the first time you build. After that, you can simply use the update command to get the latest changes to the submodule.

GENERATE BLAWG

Now that the theme exists, we can build:

pelican -s pelican.conf.py content -o output

This takes the Markdown files from the content folder and generates static HTML pages inside the output directory. That's it. No MySQL, no PHP, etc...

It works, SHIPIT!!!!11

You can use any web server to view the generated HTML. For example, Python's builtin simple HTTP server:

cd output
python -m SimpleHTTPServer

And now you should see the blog at: http://localhost:8000

Workflow for blog posts

If you're interested in writing a blog post for the site, you need to:

  • Fork the repo
  • Hack hack hack
  • Push the changes to your repo; preferably to a topic branch, like why-i-love-linux
  • Make a pull request against the master branch

Contact

If you have any questions, drop by #nairobilug on Freenode. Happy blogging!

About

Nairobi GNU/Linux Users Group website

nairobilug.or.ke