Nikola 5.3 released

I am happy to announce the release of Nikola version 5.3. It includes some minor features and a good amount of bugfixing. Upgrading to it should not cause you any trouble, as far as I know.

Here's the changelog:

Features

  • Bootstrap 2.3.0

  • Optionally use content distribution networks for jquery and twitter-bootstrap (USE_CDN option)

  • Improve progressive rendering by moving javascript to the bottom of pages

  • New Brazilian portuguese translation.

  • New planetoid experimental extra_plugin

Bugfixes

  • Make really sure we import the right conf.py

  • Make SLUG_TAG_PATH a config dep for most pages

  • Removed meta title tag for better HTML validation

  • Removed #999 background from footnote backlink.

  • Made footnote references be superscripted.

  • Centered figure's image and caption.

  • Removed outset border from admonitions.

  • Use default theme as last resource for messages/translations

  • DATE_FORMAT option was being ignored

  • Remove trailing "" on windows gallery links (Issue #298)

  • Inconsistent breadcrumbs in gallery pages (Issue #303)

  • Use source files as bundle dependencies instead of outputs (Issue #294)

Enjoy!

Nikola 5.2 released!

I am thrilled to announce that you can now download Nikola 5.2.

What's new in this version? A LOT. Don't let the minor version tick fool you, this version is packed with goodness. Let's start with features:

You can easily embed more content:

  • New vimeo directive for restructured text.

  • Custom "gist" directive providing reStructured text support for GitHub gists.

You can write your content in almost any markup:

  • Textile markup support.

  • Creole Wiki markup support.

  • txt2tags markup support.

  • bbcode markup support.

  • And of course, it still supports reStructured text, Markdown and HTML.

More languages:

  • New Catalá translation

  • New polish translation.

  • New Simplified Chinese translation.

  • Use multilingual Disqus (although it doesn't seem to work)

You can import your data:

  • New Blogger/Blogspot importer

  • Much improved Wordpress importer

  • Extract metadata from filename by using regexp (helpful for importing from octopress or other systems).

You can do fancier and more configurable sites:

  • One-page, dynamic-loading, client-rendered site plugin (task_mustache)

  • Recursive post/story folders

  • New COMMENTS_IN_GALLERIES and COMMENTS_IN_STORIES options.

  • Local search based on Tipue (extra_plugins/task_localsearch)

  • Added comments to image galleries

  • New option RSS_TEASERS

  • New STORY_INDEX option to generate index.html in story folders.

  • Add multi size favicon support.

You can use Python 2.6 or higher ... including Python 3. The only missing bit for full Python 3 support is Google sitemap generation.

And of course, a lot of bugs got smashed:

  • Added sane defaults for most options, so you can have a lean config file.

  • Made layout of the site theme responsive, with collapsing navbar.

  • Use timeline instead of parsing post_pages in generic_page_renderer and task_render_pages.

  • Updated disqus integration code, added identifiers so it works on any URL.

  • Make sure folder links end in "/" in the gallery code.

  • Removed copy of PyRSS2Gen, made it a dependency.

  • Detect "namespace" dependencies for Mako templates.

  • Use consistent encodings in RSS feeds.

  • Refactored disqus code into separate helpers

  • Use the correct extension (or raise an error) on new_post

  • Fix titles that include quotes

  • Updated to current CSS from docutils (was using version from 2005)

  • Avoid needless regeneration of gallery indexes.

  • Always ensure the folder for the new post exists.

  • Get title from filename if not available in metadata.

  • Don't copy sources if they end in ".html"

  • Don't link to unexisting translations.

  • Sort tags case insensitive.

Enjoy!

Nikola 5.1 Released

I am happy to announe release 5.1 of Nikola a static site/blog generator.

Features

  • Support for client-side cloud tags

  • New slides directive, for image slideshows.

  • New option DATE_FORMAT

  • New "nikola console" command

  • New option CACHE_FOLDER

  • Updated bootstrap to 2.2.2

  • Wordpress importer supports redirects

  • Wordpress importer creates a url_map for Disqus thread migration

  • Wordpress importer: support for [sourcecode]

  • Added unstyled theme "orphan", useful as a base for independent themes.

  • New "monospace" theme.

  • New "Create a Theme From Scratch" tutorial.

Bugfixes

  • Added ID attribute to gallery images for backlinking.

  • Added ALT attribute to gallery images.

  • Issue 113: refactored code in Mako templates

  • Added newline after metadata in new_post template.

  • Issue 112: RSS feeds contained invalid links

  • Issue 88: RSS feed validation via lxml

  • Isuue 169: build subcommands were broken

  • Switched addThis to Peekaboo style, as seen on flexion.org (seems less broken)

  • Remove duplicated sample config file. always build it from template (schettino72)

  • Don't use hardcoded path for custom.css (schettino72)

  • Wordpress importer: fixed issue 190, convert embedded H1 tags into H2

  • Fixed bad interaction with Yapsy 1.10

  • More elegant handling of "nikola init"

  • Don't crash if there's no assets to copy

Nikola v5 Released

A new version of Nikola is out! You can get it at the usual place.

This version is not completely backwards compatible, thus the new major version number, but switching to it should be easy-ish. If you are using version 4.0.3:

  1. Remove your dodo.py

  2. Use nikola build instead of doit from now on

  3. use nikola serve instead of doit serve, nikola new_post instead of doit new_post, and so on. Some other doit task are also converted into nikola command you can get the list using nikola help

The integration of doit into Nikola is not done in a very nice way, that's still ongoing work, but it should be Good Enough To Work (TM).

Hope you enjoy this release!

Features

  • Templates now know their name from template_name in their context.

  • Made most of Nikola into Yapsy plugins.

  • Recurse galleries/ and render each folder as a gallery.

  • Breadcrumbs and folder links in image galleries.

Bugfixes

  • Fixed doc installation

  • Put webassets cache in cache/webassets

  • Update to doit 0.17

  • Don't crash on incomplete translations

  • Fixed Issue 160: render_tags didn't call scan_posts()

  • Fixed Issue 161: webassets setting USE_BUNDLES was ignored (fix by schettino72)

  • Fixed Issue 153: index.txt was being ignored in galleries.

Bugfix Version 4.0.3 Released

Version 4.0.3 is released

This is strictly a bugfix release, which fixes the following issues:

  • Handle empty posts without crashing.

  • Treat wordpress imported posts as Markdown.

  • Download attachments from wordpress

  • Fix links to attachments so they work

  • Change the global/local order of contexts on templates.

  • Link tag's feed in tag's pages.

  • Fix empty tag feeds.

  • Refactored Post out of nikola.py

Nikola 4.0.2 released

New bugfix release available for download. Here are the changes in this version:

Features

  • Updated to bootstrap 2.1.0

  • Italian translation by Pierpaolo Da Fieno

  • Index-like tag pages with the TAG_PAGES_ARE_INDEXES option

Bugfixes

  • Handle broken EXIF dates

  • Ignore .pyc files in the listings folder

  • Don't fail on render_pages when there is no content at all

  • Don't fail on render_posts when there is no content at all

  • Don't fail on render_sources when there is no content at all

  • Don't fail on build_bundles when there are no bundles

  • Added missing listing.tmpl to jinja-default theme

  • Added default for DEFAULT_LANG

  • Added default for TRANSLATIONS

  • Fixed getting metadata from post file.

  • More resistence to broken EXIF data.

  • Made jinja-default follow default more closely.

  • Don't say "reSt", say "Source" since it can be markdown or other stuff.

Nikola 4 Released

I have just uploaded release 4 of Nikola. Here are some of the changes in this version:

Features

  • Previous/Next post links

  • Teaser support

  • Support posts with HTML "sources"

  • Site checking script (nikola_check)

  • Maximum image size in galleries

  • Image descriptions in galleries

  • Image exclusion in galleries

  • Special "draft" tag

  • Pretty code listings ("code galleries")

  • Page descriptions

  • Easy theme tuning via Bootswatch

  • Support for WebAssets bundles

  • "Filters" for powerful file post-processing

Bugfixes

  • Improved HTML output

  • Support multiple time formats in post metadata

  • Slugify tag names for URLs

  • Archive path and filename configurable

  • Galleries sorted by date (supports EXIF)

  • Rotate gallery thumbnails (EXIF)

  • Tag feeds in tag pages

  • Colorbox support in restructured text figures

  • Fix for content displaying too wide

  • Changelog

As usual, you can discuss bugs or make feature requests at the nikola-discuss group and I love to know of sites using Nikola.

Hope you like it!

A Simple Nikola Link Checker

One of the most important things when you are building a static site generator like Nikola is that your site should not be broken. So, I really should have done this earlier ;-)

This is a very simple link checker that ensures the pages Nikola generates have no broken links. I will make it part of Nikola proper once it's more polished and doit supports getting a list of targets

To try it, get it and run it from the same place where you have your conf.py, right after you run doit.

import os
import urllib
from urlparse import urlparse

import lxml.html

def analyze(filename):
    try:
        # Use LXML to parse the HTML
        d = lxml.html.fromstring(open(filename).read())
        for l in d.iterlinks():
            # Get the target link
            target = l[0].attrib[l[1]]
            if target == "#":  # These are always valid
                continue
            parsed = urlparse(target)
            # We only handle relative links.
            # TODO: check if the URL points to inside the generated
            # site and check it anyway
            if parsed.scheme:
                continue
            # Ignore the fragment, since the link will still work
            # TODO: check that the fragment is valid
            if parsed.fragment:
                target = target.split('#')[0]
            # Calculate what file or folder this points to
            target_filename = os.path.abspath(
                os.path.join(os.path.dirname(filename), urllib.unquote(target)))
            # Check if it exists, or report it
            if not os.path.exists(target_filename):
                print "In %s broken link: " % filename, target
    except Exception as exc:
        # Something bad happened, report
        print "Error with:", filename, exc

# This is hackish: we use doit to get a list of all
# generated files. Minor modifications would let you check
# the non-generated files as well.

for task in os.popen('doit list --all', 'r').readlines():
    task = task.strip()
    if task.split(':')[0] in (
        'render_tags',
        'render_archive',
        'render_galleries',
        'render_indexes',
        'render_pages',
        'render_site') and '.html' in task:
            # It looks like a generated HTML file
            analyze(task.split(":")[-1])

Nikola is FAST.

A fast-loading site is a good thing. Your site's speed matters. Which is why creating fast sites is one of Nikola's design goals.

Sure, it's not meant to create e-commerce sites, but if you are doing just a simple corporate site, or a personal blog, why would you not make it as fast as possible anyway?

So, here's one data point, from Kay Hayen

http://www.nuitka.net/posts/images/nikola-speed-improvements.png

Guess when Kay switched to Nikola.

But you don't have to just believe that graph. Here's Yahoo's YSlow report on my personal blog, which is hosted in a $5 VPS (as is this site, BTW. The same VPS. As is a bunch of services. And my Quassel core)

http://ubuntuone.com/6Xsg1blhiJK7nEcnhPFOM7

It scores 94 on that test. That's 94 out of 100 possible points in the "Small Site or Blog" ruleset.

How much server tuning was needed? I added one line to the Apache config:

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css

That makes it compress those files before sending it to the user and improved the third item from F to A.

So, when I say Nikola makes your site fast, don't take my word for it, just check it out.