In most cases pagination is better than traditional “previous – next” navigation as it offers visitors a more quick and convenient navigation through the site. It’s not a must, but a useful nice-to-have-feature.
So here is a gist to add pagination to your Octopress blog.
All you need to do is to replace the pagination section in /source/index.html.
If you need to keep backups of your instance in EC2, then you can set a cron job to take a snapshot every hour and then run a python script for removing the unwanted snapshots.
I was trying to get PIL to work on my ubuntu box but it failed to handle JPEGs. The system responded with the dreaded “IOError: decoder jpeg not available”. Here is what I did to solve it…
I am running my pylons project through a virtual environment. All the libraries are installed with pip, always run from within the virtual environment. When I tried to use PIL on my MAC I had no problems, but the same code just failed on Ubuntu (I was trying to generate some thumbnails from JPEGs).
The reason was that PIP was not installed properly. It required for the installation some libraries for dealing with JPEGs which it failed to find. What you have to do is tell it where to get it from. Before doing that make sure that your system has the necessary libraries. This seems to be enough for most cases:
1
sudo apt-get install libjpeg62-dev
If this does not do it, then try all the other possible libjpeg libraries. Now follow the steps:
Step 1: Download the code of PIL with pip (or rather uninstall PIP first - pip uninstall PIL)
1
/myEnv/bin/pip install --no-install PIL
This should download the source in the build directory of your environment.
1
cd /myEnv/build/PIL
Step 2: Edit the setup.py file
Find this line:
1
JPEG_ROOT = None
and change it to:
1
JPEG_ROOT = libinclude("/usr/lib")
Have a look at the setup.py in case you need to specify separately the lib and the include directory.
Step 3: Finish the installation
1
/myEnv/bin/pip install PIL
If all went well then you should see at the end of the installation something like this (see the JPEG line):
1234567
-------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------
If you by chance have to work with python mako templates in Sublime Text 2, I have some good news for you… There is a workaround to have enable syntax highlighting.
There is a Mako bundle for TextMate at the URL below which also works for Sublime Text 2, my favorite editor.
Download and extract the file locally and then move the extracted folder under ~/.config/sublime-text-2/Packages/. At least that’s the path on my Ubuntu machine.
In order to make it work I had to remove the code below from the HTML (Mako).tmLanguage file because it was throwing errors.