<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <title>Blogofile</title>
    <link>http://www.blogofile.com/blog</link>
    <description>A static blog engine/compiler</description>
    <pubDate>Sun, 01 May 2011 19:23:16 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Preview of Blogofile 0.8</title>
      <link>http://www.blogofile.com/blog/2011/04/30/preview-of-blogofile-0.8</link>
      <pubDate>Sat, 30 Apr 2011 13:42:04 EDT</pubDate>
      <category><![CDATA[development]]></category>
      <guid>b'1prqgKJ6YXwljJSKr9r5kpE49F4='</guid>
      <description>Preview of Blogofile 0.8</description>
      <content:encoded><![CDATA[<p>I'm hard at work on Blogofile 0.8 which is going to be a <strong>huge</strong> upgrade
from 0.7.1. I want to start writing down some of the new features and
things that have changed, so as not to overwhelm you all at once on the
day of release.</p>
<p>Here's a brief changelog from 0.7.1 to 0.8:</p>
<ul>
<li>Python 3 support! Blogofile now runs on Python 2.6, 2.7, 3.1 or 3.2.</li>
<li>Plugins.</li>
<li>New template engines.</li>
<li><code>blogofile build</code> now works from any subdirectory in your source tree.</li>
<li>Cross-python-version unit tests with <a href="http://codespeak.net/tox/">Tox</a>.</li>
<li>Full stack testing with in-browser <a href="http://seleniumhq.org/">Selenium</a> tests.</li>
<li>HTML 5 Boilerplate enabled site templates.</li>
<li>Command line completion and plugin commands.</li>
<li>Blogger import script (contributed by Seth de l'Isle)</li>
<li>Markdown <a href="http://www.freewisdom.org/projects/python-markdown/Extensions">extensions</a>
   are enabled by user configuration.</li>
<li>Static files can be configured to hard link rather than copy into
   the _site directory (Contributed by Nick Craig-Wood)</li>
</ul>
<p>These are all planned features for 0.8, and they are all at least
partially implemented, but I'm still working on polishing them up, so
they may or may not be fully working at the moment. This is just a
preview.</p>
<h2>Python 3</h2>
<p>With the release of Python 3.2, py3k has finally matured into a stable
and well built product. All of the dependencies of Blogofile are working
well on Python 3, and therefore it's the right time to move forward and
have Blogofile embrace Python 3 as well.</p>
<p>Going forward, all new development on Blogofile is being done in
Python 3.2. This does not mean however, that I'm abandoning Python
2 -- that would be catastrophic. There are a lot of reasons you may want
to stay with Python 2: it's what you know and are comfortable with, a
library you depend on only works in older versions, you feel Python 3
isn't mature yet (but it is!) For many reasons, it's important that
Blogofile remains working in Python 2 just as well it does in Python
3. Even this site, blogofile.com, is still running on Python 2 because
Sphinx (stable) doesn't yet support Python 3.</p>
<p>Blogofile 0.8 introduces what I hope to be a smooth migration for
people who want to use Python 3, but also to maintain full feature
compatibility for users still using Python 2.</p>
<p>The <a href="http://github.com/EnigmaCurry/blogofile">source code at github</a>
is all Python 3 code. If you're checking out from git, you will need
Python 3. Python 2 versions are built by converting this code with the
<a href="http://pypi.python.org/pypi/3to2_py3k/1.0">3to2</a> tool. This is
automated through the standard sdist facility:</p>
<pre><code>python setup.py sdist
</code></pre>
<p>This packages a tarball in the <code>dist/</code> directory that contains both
the regular python3 source code as well as the python2 source
code. Depending on the python version used to install it, the correct
source code gets installed. This is the same type of tarball that will
be uploaded to <a href="http://pypi.python.org/pypi">PyPI</a> once Blogofile is
stable and is released. Users will be able to run <code>pip install
blogofile</code> on any version of Python (2.6+, 3.1+) and run blogofile
without any hassle, and no need for the end user to install 3to2
because the conversion has already been applied.</p>
<p><a href="http://codespeak.net/tox/">Tox</a> is a testing tool that leverages
<a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a> to run unit tests
within multiple Python environments. Blogofile is currently using Tox
to verify that sites built with Blogofile work well in multiple Python
versions.</p>
<h2>Plugins</h2>
<p>Blogofile 0.8 includes new plugin support. Plugins are just packages
of controllers, filters, templates, and other files. These are
distributed and installed as regular python packages (eg. <code>easy_install
blogofile_blog</code>). Since plugins are installed separately from
Blogofile, you can upgrade them independently. Installed plugins are
detected by Blogofile at runtime and if the user configures the plugin
in their <code>_config.py</code>, the plugin can add functionality to a Blogofile
site.</p>
<p>The blog controller from 0.7.1 has been completely removed from
Blogofile and has been <a href="https://github.com/EnigmaCurry/blogofile_blog">repackaged as a
plugin</a>. This has many
advantages:</p>
<ul>
<li>New stable releases of Blogofile and the blog controller are now
   independent of each other.</li>
<li>The blog controller is no longer placed into the user's site source
   code. Instead, the controller remains in the Python library
   directory and is only referenced and configured in the user's
   <code>_config.py</code>. This let's you upgrade your site to new versions
   without having you to delete or otherwise modify your <code>_controllers/</code>
   directory as you do now in Blogofile 0.7.1 or older. The blog
   templates (post.mako, chronological.mako etc.) can be copied into
   userspace and customized if desired.</li>
</ul>
<p>Also note, that you don't have to use the blog plugin if you don't
want to, you can just as easily keep using the old blog controller
from 0.7.1 if you have a legacy site.</p>
<h2>Command Completion and Plugin Commands</h2>
<p>0.8 introduces bash command line completion. Partially typing a
blogofile command and then pressing the TAB key will complete the
command you're typing or will provide you with a list of possible
completions.</p>
<p>This can be turned on by placing the following into your <code>~/.bashrc</code>
file:</p>
<pre><code>command -v blogofile &amp;&gt;/dev/null &amp;&amp; source &lt;(BLOGOFILE_BASH_BOOTSTRAP=true blogofile)
</code></pre>
<p>Plugins can now extend the blogofile command line executable with
their own commands, which makes command line completion all the more
convenient. For instance, these are the commands implemented in the
blog plugin:</p>
<pre><code>usage: blogofile blog [-h] {templates,post} ...

positional arguments:
  {templates,post}
    templates       Blog template helpers
    post            Blog post helpers
</code></pre>
<p>Typing <code>blogofile blog post create &lt;title&gt;</code> will create a new blog
post inside your <code>_posts/</code> directory pre-populated with today's date and the
title you gave it. This allows you to get started writing your blog
posts more easily without having to write all the post YAML
yourself. This feature was created in collaboration with <a href="http://www.antzucaro.com/">Ant Zucaro</a>.</p>
<p>Running <code>blogofile blog templates copy _templates/blog</code> will copy all
of the blog templates into your site's source directory. This let's
you customize them to your own liking. If you do this, you need to
write the following in your <code>_config.py</code> to tell the blog controller
where to refer to these templates:</p>
<pre><code>plugins.blog.template_path = "_templates/blog"
</code></pre>
<h2>Template Engines</h2>
<p>Blogofile has supported <a href="http://www.makotemplates.org/">Mako</a> as it's
templating engine ever since its first release. I personally feel that
Mako is the very best templating engine available for Python, but
you're free to have a different opinion. I think choice is also a
great thing, so Blogofile template support has been abstracted to
support other engines. Included in 0.8 is a
<a href="http://jinja.pocoo.org/">Jinja2</a> implementation (which is very
similar to Django templates) and a new blogofile specific template
called <code>FilterTemplate</code>.</p>
<p>The user's <code>_config.py</code> now configures a mapping of file extension
to template type. Here's what you get by default:</p>
<pre><code>templates.engines = HC(
  mako = MakoTemplate,
  jinja = JinjaTemplate,
  jinja2 = JinjaTemplate,
  markdown = MarkdownTemplate,
  rst = RestructuredTextTemplate,
  textile = TextileTemplate
  )
</code></pre>
<p>If you've been using Blogofile long, you already know about the
first one: Mako. However, instead of being hard-coded inside the
blogofile <a href="https://github.com/EnigmaCurry/blogofile/blob/plugins/blogofile/writer.py">writer
class</a>
to render files ending in <code>.mako</code> with Mako, Blogofile 0.8 uses the
above configuration to know what template type to associate it
with. So, <code>.mako</code> gets rendered with the MakoTemplate class,
<code>.jinja</code> and <code>.jinja2</code> get's rendered with JinjaTemplate etc. Feel
free to redefine this yourself in your own <code>_config.py</code> if you feel
the need.</p>
<p>An important configuration item sets the site base template:</p>
<pre><code>site.base_template = "site.mako"
</code></pre>
<p>By default it's called <code>site.mako</code> which is consistent with how
<code>simple_blog</code> has always called it. It's more important now to realize
what this file is however, because all templates, <strong>even templates of
different engines</strong> can inherit from this file. For instance, if your
site uses <code>site.mako</code> as it's base template but you have a jinja2
template somewhere in your source directory (or a plugin you installed
uses one), you don't have to recreate your entire site structure in jinja
-- instead, you can have jinja2 inherit from your mako templates
directly:</p>
<pre><code>{% extends "bf_base_template" %}
</code></pre>
<p>When you render a template, Blogofile detects if
<code>site.base_template</code> is of a different template type than the
currently rendering template. If it is, it renders the base template
first, installs the base template as an alias called
<code>bf_base_template</code>, then renders the first template inside of the
base template at the right place. The "right place" is also
configurable via <code>templates.content_blocks</code>, but you shouldn't need
to change that unless you're introducing your own template engine.</p>
<p><code>FilterTemplates</code> are a new template type altogether that lets you use
any Blogofile
<a href="http://blogofile.com/documentation/filters.html">filter</a> as it's own
template engine. This let's you use, for instance, Markdown and
reStructuredText files as standalone template types. In Blogofile
0.7.1 you could only use markdown or reStrucutredText inside blog
posts, but now you can use it anywhere you want in your site source by
placing a file ending in <code>.markdown</code> or <code>.rst</code>. These files will
also inherit your site base template, so all you need inside the file
is the content that you want on the page and it will look like all the
other pages on your site once rendered. Please be aware that markdown
and reStruturedText are not really full template engines, so if you're
doing anything complex with controllers, you probably should stick
with Mako or Jinja2. Really, it's just a convenient way to create a
static page quickly without needing to code HTML.</p>
<h2>HTML 5 Boilerplate and other example sites</h2>
<p><a href="http://html5boilerplate.com/">HTML5Boilerplate</a> is the new hotness in
web-design -- it provides a great base to start from for creating new
sites with all the new features that HTML 5 brings.</p>
<p>Blogofile is going to have a <code>simple_blog</code> variant that includes these
features:</p>
<pre><code>blogofile init simple_blog_html5
</code></pre>
<p>That will get you started. It's still unthemed just like
<code>simple_blog</code> is today. I'm working on even more variants that
include some themes to get you a decent looking site out of the box.</p>
<h2>Checking out the code and getting started</h2>
<p>If you want to start playing around with Blogofile 0.8 right now, even
before it's stable, go right ahead. I'd appreciate feedback to know
what is and isn't working for you, or any confusion you have.</p>
<p>Please note, that these instructions are only valid for people wishing
to get a preview of Blogofile and don't mind checking out the source code
from git and running code that might not be fully working yet. Also,
these instructions are about ten times longer than what will be
necessary once Blogofile is released as a stable build. Once that
happens, you won't need any virtual environments or 3to2 conversions
etc. Essentially, these instructions help to create a <strong>development</strong>
environment.</p>
<h3>Prerequisites</h3>
<ul>
<li>Python 3.1+ (even if you plan on using Python 2 to build your site)</li>
<li><a href="http://pypi.python.org/pypi/distribute">Distribute</a></li>
<li><a href="http://pypi.python.org/pypi/3to2_py3k">3to2</a> (make sure it's the Python 3 version as linked here)</li>
<li><a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a> - not required, but recommended, especially if you're
   already running a stable version of Blogofile.</li>
</ul>
<p>If you want to run the unit tests, you'll also need:</p>
<ul>
<li><a href="http://codespeak.net/tox/">Tox</a></li>
<li>Python 2.7 - This runs the selenium tests which don't support
   python 3 yet.</li>
</ul>
<h3>Install Blogofile</h3>
<p>I'll assume you're using Ubuntu Linux. If not, you'll need to translate
these instructions yourself. Developer docs that I'm currently writing
will be friendlier for non Ubuntu folks.</p>
<p>Install Python 3.2. If you're not running Ubuntu 11.04 yet, you'll need to
install the PPA for Python 3.2 and install from there:</p>
<pre><code>sudo apt-get install python-software-properties
sudo add-apt-repository ppa:irie/python3.2
sudo apt-get update
sudo apt-get install python3 python3-dev
</code></pre>
<p>Install distribute:</p>
<pre><code>sudo su -c "wget http://python-distribute.org/distribute_setup.py -O - | python3"
</code></pre>
<p>Install virtualenv:</p>
<pre><code>sudo easy_install-3.2 virtualenv
</code></pre>
<p>Make sure you have git:</p>
<pre><code>sudo apt-get install git-core
</code></pre>
<p>Checkout the Blogofile sources to a directory of your choosing which
we'll call <code>$BFSRC</code>:</p>
<pre><code>cd $BFSRC
git clone https://github.com/EnigmaCurry/blogofile.git .
</code></pre>
<p>Create a virtual environment to separate the development Blogofile
from any production version you already have installed:</p>
<pre><code>mkdir $BFSRC/venv
virtualenv -p python3.2 --no-site-packages --prompt="(blogofile-0.8)" venv
</code></pre>
<p>To enter the virtual environment run:</p>
<pre><code>source $BFSRC/venv/bin/activate
</code></pre>
<p>You'll see your prompt now has <code>(blogofile-0.8)</code> prepended to it,
indicating that you're currently in the virtual environment. You'll
need to run the source command above each time you start a new
terminal window to re-enter the virtual environment.</p>
<p>If you decided to run Blogofile with python3, you're ready to install
Blogofile as a development library:</p>
<pre><code>python setup.py develop
</code></pre>
<p>This pulls down all the dependencies of Blogofile from the internet
and installs Blogofile as a system library in place (inside the
virtualenv of course), so any changes you make to the source
or pull from git will automatically be applied.</p>
<p>If you wanted to run Blogofile in python2, there's an extra step you
must take to convert the sources:</p>
<pre><code>easy_install 3to2_py3k
python setup.py sdist
</code></pre>
<p>This converts all the python source to be compatible with python2 via
3to2. It creates a tarball in the <code>dist/</code> directory which you can
then install with python2 (outside this python3 virtualenv):</p>
<pre><code>easy_install dist/Blogofile-0.8-DEV.tar.gz
</code></pre>
<p>You should now have Blogofile 0.8 installed in a virtual environment
which you can verify by running:</p>
<pre><code>blogofile info
</code></pre>
<p>You'll see which blogofile you're running and information about where
it's pulling data from:</p>
<pre><code>This is Blogofile (version 0.8-DEV) -- http://www.blogofile.com
You are using CPython 3.2.0 from /home/ryan/src/blogofile/venv/bin/python
Blogofile is installed at: /home/ryan/src/blogofile/blogofile
Default config file: /home/ryan/src/blogofile/blogofile/site_init/_config.py
The specified directory has no _config.py, and cannot be built.
</code></pre>
<p>You can see the following from my configuration above:</p>
<ul>
<li>I'm using Blogofile version <code>0.8-DEV</code></li>
<li>I'm using CPython 3.2.0</li>
<li>Blogofile is installed inside my virtual environment at <code>/home/ryan/src/blogofile</code></li>
</ul>
<p>If <code>blogofile info</code> shows you a similar configuration, you've
installed it correctly.</p>
<h3>Install Blog Plugin</h3>
<p>As mentioned earlier, the blog plugin is a separate install from
Blogofile itself. You can install it in the same virtual environment
created in the last step. Create a new directory parallel to
<code>$BFSRC</code>, I'll call it <code>$BF_BLOG_SRC</code>:</p>
<pre><code>mkdir $BF_BLOG_SRC
cd $BF_BLOG_SRC
git clone https://github.com/EnigmaCurry/blogofile_blog.git .
python setup.py develop
</code></pre>
<p>Just like Blogofile, if you're wanting to run the blog plugin in
Python 2.6+, you'll need to convert the source into a 2.x compatible
tarball and install that:</p>
<pre><code>python setup.py sdist
easy_install dist/blogofile_blog-0.8.tar.gz
</code></pre>
<h3>Testing</h3>
<p>You can now create a <code>simple_blog</code> for testing:</p>
<pre><code>mkdir $BFSRC/test_site
cd $BFSRC/test_site
blogofile init simple_blog
blogofile build
blogofile serve 8080
</code></pre>
<p>The site should build and serve locally at <a href="http://localhost:8080">http://localhost:8080</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Syntax Highlighting and Markdown support</title>
      <link>http://www.blogofile.com/blog/2009/03/09/syntax-highlighting-and-markdown</link>
      <pubDate>Mon, 09 Mar 2009 17:43:00 EDT</pubDate>
      <category><![CDATA[development]]></category>
      <guid>http://www.blogofile.com/blog/2009/03/09/syntax-highlighting-and-markdown</guid>
      <description>Syntax Highlighting and Markdown support</description>
      <content:encoded><![CDATA[<p>The development version of blogofile now includes the following features:</p>
<ul>
<li>Syntax highlighting - thanks to <a href="http://www.pygments.org">pygments</a></li>
<li>Markdown support - thanks to <a href="http://www.freewisdom.org/projects/python-markdown/">markdown in python</a></li>
</ul>
<p>Check out <a href="/demo/sample_posts.html">some examples here</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>

