Squid is a static blog site generator built on Flask. One creates Markdown pages and posts and Squid maps those files to routes.
To use Squid, you should first have virtualenv installed. If you don't, you can install it
$ sudo pip install virtualenv
Once you have virtualenv installed, clone a copy of this repo. Make sure you're in the projects root directory and create a new environment.
$ virtualenv env
This will create a directory named
env with an isolated Python environment. To use it, run:
$ source env/bin/activate
You can tell that you're in the virtual environment by the (env) at the beginning of your terminal. Now use
install Flask and other requirments.
$ pip install -r requirements.txt
Done! To launch the application, run:
$ python run.py
You can now access your Squid install at http://localhost:5000.
Creating a Post
Creating a new post is easy. Make a new file in the
templates/posts/ directory. The filename must be in the following format:
The first part of the filename is the date in
YYYYMMDD format. The second part of the filename is the title to be used, with the
words seperated by underscores. All letters must be lowercase. Lastly, the file must have the
.md extension, which stands for "Markdown".
For example, lets say today is Feb 15th, 2012 and you want to create a post with the title "10 Reasons Why Eating Rainbow Cookies Wont Make You A Magical Unicorn". You would create this file:
Squid automatically lists new posts on the front end of the site, and will map routes matching the post title. To access the post, you would go to (assuming you're running on localhost):
To create a draft post, that wont show up automatically on the index page and cant be accessed via a route, prepend the filename with an underscore.
Creating a Page
Creating a page is even easier than a post. Simply create a file in
templates/pages/ with the title of the page. Pages dont require
the date stamp at the beginning of the file.
The above file would be accessible at:
I built Squid as a fun learning project, and ended up using it to run my blog. You can check out a live working copy of Squid at http://geekforbrains.com
Below are a list of features I plan on adding in the future:
- Portfolio/Photo Gallery
- RSS for posts
Squid is built on and inspired by the software and tools below: