Author pages in Nikola v7.7.0

Since version 7.7.0 Nikola renders author pages for sites with more than one author. Let me talk a little about this.

The first Nikola site I set up was for a group of friend wanting to publish tech stuff online (for example, how to build a 3D printer with recycled elements). I noticed that author names in posts weren't linked to any page. And because this is a very common feature in blogging systems, I implemented it.

The feature can be enabled in conf.py with:

ENABLE_AUTHOR_PAGES = True

As with tags, you can configure the pages path and if you want to list links to the posts or the posts themselves:

AUTHOR_PATH = "reporters"
AUTHOR_PAGES_ARE_INDEXES = False

Additionally, this is not required, you can add a little bio to each (or some) authors and hide others (this is, don't generate pages for them):

AUTHOR_PAGES_DESCRIPTIONS = {
    DEFAULT_LANG: {
        "Juanjo Conti": "Python coder and writer.",
        "Roberto Alsina": "Nikola father."
    },
}
HIDDEN_AUTHORS = ['Guest']

If you want to link to these pages in your own theme, you can use something like this (Mako example):

% if author_pages_generated:
    <a href="${_link('author', post.author())}">${post.author()}</a>
% else:
    ${post.author()}
% endif

You can see the feature in action on the Nikola blog: author page example, all authors page example.

Hope you enjoy it!

What is Nikola?

Nikola is a static site and blog generator, written in Python. It can use Mako and Jinja2 templates, and input in many popular markup formats, such as reStructuredText and Markdown — and can even turn Jupyter (IPython) Notebooks into blog posts! It also supports image galleries, and is multilingual. Nikola is flexible, and page builds are extremely fast, courtesy of doit (which is rebuilding only what has been changed).

Find out more at the website: https://getnikola.com/

Nikola v7.7.0 is out!

On behalf of the Nikola team, I am pleased to announce the immediate availability of Nikola v7.7.0. It fixes some bugs and adds new features.

What is Nikola?

Nikola is a static site and blog generator, written in Python. It can use Mako and Jinja2 templates, and input in many popular markup formats, such as reStructuredText and Markdown — and can even turn Jupyter (IPython) Notebooks into blog posts! It also supports image galleries, and is multilingual. Nikola is flexible, and page builds are extremely fast, courtesy of doit (which is rebuilding only what has been changed).

Find out more at the website: https://getnikola.com/

Key Changes since v7.6.4

  • Sections by Daniel Aleksandersen
  • Author pages by Juanjo Conti

Downloads

Install using pip install Nikola or download tarballs on GitHub and PyPI.

Changes

Features

  • New support for online CSS and JS minifying services (Issue #1999)
  • Make tag optional with USE_BASE_TAG flag (Issue #1985)
  • Render author pages (Issue #1972)
  • Atom feeds for tag lists (Issue #1686)
  • New THEME_COLOR option for customizing themes from a primary color (Issue #1980)
  • New color_hsl_adjust_hex and colorize_str_from_base_color functions available in themes (Issue #1980)
  • New POSTS output subfolders now generate sections by default (Issue #1980)
  • New POSTS_SECTIONS and POSTS_SECTION_* options for configuring the section pages (Issue #1980)
  • For themers: Each post are now associated with section_color, section_link, and section_name (Issue #1980)
  • Each new section page has a auto-assigned color based on shifting the hue of THEME_COLOR based on a hash of the section name, can be overwritten with POSTS_SECTION_COLORS option (Issue #1980)
  • New TAG_PAGES_TITLES and CATEGORY_PAGES_TITLES options (Issue #1962)
  • Add Bosnian and Serbian (Latin) languages, by Saša Savić [bs, sr_latin]
  • Add Portuguese (Portugal) language, by jamatos [pt]

Bugfixes

  • Make nikola tabcompletion work outside sites (Issue #1983)
  • Fix display of categories list in bootstrap theme (Issue #2002)
  • If webassets is not installed, use unbundled assets (Issue #1992)
  • Check links in Atom and sitemap files (Issue #1993)
  • Link checker should check all absolute URLs to self (Issue #1991)
  • Check img|source[@srcset] as part of check -l (Issue #1989)
  • Clean up translations for third party components
  • pagekind["main_index"] set on the main indexes to differentiate them from all the other indexes.
  • Add dependency on metadata file for 2-file posts (Issue #1968)
  • Set UTF-8 charset in Content-Type or text/ and +xml (Issue #1966)

New feature in Nikola: Sections

The sections feature has been removed from Nikola v8 and replaced by categories, with some features added. Read v8 upgrade guide to find out more

This post is reproduced with permission from the author. See it in the original site

Sections are like newspaper sections that let you group related content together in a collection. Every post from a section appear under a common name, folder/address, and optionally use distinct styling. They also have their own landing pages containing an index with all their posts and their own syndication feed. With sections and post collections, you can diversify your Nikola blog by writing on different topics all on the same website. Readers who are only interested in one subsection of the content you publish can subscribe to the feed of the section or sections that interest them the most.

In Nikola, sections are normally built automatically based on the output folders specified in the POSTS option. Each output folder is a new section. The index pages and feeds for each section will be output in the same directory as the posts. Alternatively, sections can be assigned using a section property in each post’s metadata. Note that this will not change the output folder or address of a post and thus lose some of the uniformity you get with having posts include their section name as part of their address.

The following configuration example demonstrates how three sections on different topics are created. The first argument is the source path to where the posts are stored, the second argument is the output folder and section name, and the third argument is the template to use for each section. Posts can use the same template, but you may want to customize the template for each section with bigger hero images on your food section and special star rating systems and different HTML markup for your reviews.

POSTS = {
    ('posts/blog/*.md', blog', 'post.tmpl'),
    ('posts/food/*.md', 'food', 'post_recipe.tmpl'),
    ('posts/review/*.md', 'review, 'post_reviews.tmpl'),
}

Posts cannot be added to multiple sections as this might create duplicate pages with different addresses. Duplicate pages is something you will want to avoid in most cases. If you really want a post to appear in multiple sections, you’re looking for Nikola’s tags or categories functionality.

Some customizations I’ve made to my own templates after reorganizing to use sections:

  • Display the name and color of the section a post belongs to on the front page.
  • Display a link to syndication feed for each section as well as the everything-feed at the top of each section and post belonging to that section.
  • Breadcrumb navigations from posts to their sections and from the sections to the front page. Encourages visitors to your site to find more content from the same section.

Additionally, each section and every post in that section will be automatically assigned a color created by shifting the hue of the site’s THEME_COLOR option in the HUSL color space. This creates a visually similar color that can be used to style the posts and the sections in a uniform way, allowing each section to have a unique style of their own. The color can be called from a theme using post.section_color() and can be used in an inline styles or a style element. The color manipulation functions can also be accessed directly in theme templates, allowing for shifting hue, saturation, or lightness of a given color. For example, a lighter version of a section’s color can be retrieved using color_hsl_adjust_hex( post.section_color(), adjust_l=0.05 ).

The options for controlling the behavior of sections are better documented in conf.py and include:

  • POSTS_SECTIONS for enabling or disabling sections (on by default)
  • POSTS_SECTION_ARE_INDEXES for making posts lists instead of indexes
  • POSTS_SECTION_COLOR for manually assigning colors to sections rather than auto-generated colors from THEME_COLOR
  • POSTS_SECTION_NAME for naming sections separately from their output folders
  • POSTS_SECTION_TITLE for controlling the title of the section indexes
  • POSTS_SECTION_DESCRIPTION for giving each section a description

There is currently no way of generating a list of all sections. A site is not expected to need more than three–twelve sections at the most.

Sections will be available in Nikola version 7.7.0 due later this week. The sections feature has been removed from Nikola v8 and replaced by categories, with some features added. Read v8 upgrade guide to find out more

Drop by the Nikola mailing list or chat roomif you’ve built something cool with sections or just need a little help.


What on Earth is “Nikola,” anyway?

Nikola is a static site generator built in Python. What that means, is that it can turn a collection of text files into a beautiful website using templates and a collection of ready-made themes. This website, even this very page!, was built using Nikola. Learn more at the Nikola website.

I’ve contributed to the development of Nikola for the last two years — the new sectioning system only in the last week — and I’m really happy with how Nikola works, the community, and especially how it has helped me build a great website that I’m really proud of.

Nikola v7.6.4 is out!

On behalf of the Nikola team, I am pleased to announce the immediate availability of Nikola v7.6.4. It fixes some bugs and adds new features.

What is Nikola?

Nikola is a static site and blog generator, written in Python. It can use Mako and Jinja2 templates, and input in many popular markup formats, such as reStructuredText and Markdown — and can even turn Jupyter (IPython) Notebooks into blog posts! It also supports image galleries, and is multilingual. Nikola is flexible, and page builds are extremely fast, courtesy of doit (which is rebuilding only what has been changed).

Find out more at the website: https://getnikola.com/

Downloads

Install using pip install Nikola or download tarballs on GitHub and PyPI.

Changes

Features

  • Checking remote links also checks redirects (nikola check -lr)
  • Update suggested license to its latest version (Issue #1950)
  • Add Punjabi language, by Jasdeep Singh (Issue #1940)
  • New option to use custom, and several TEASER_END values

Bugfixes

  • Rewrite srcset links (Issue #1939)
  • Add dependencies for include tag in Mako (Issue #1956)
  • Don’t duplicate BLOG_TITLE in the front page title (Issue #1952)
  • Escape instead of strip HTML in titles (Issue #1952)
  • Make LINK_CHECK_WHITELIST apply to remote link checks
  • Make STORY_INDEX work together with PRETTY_URLS (Issue #1949)
  • Refactor new_post to match lazy plugin loading (Issue #1943)
  • Make Nikola startup faster by not loading useless plugins (Issue #1825)
  • Ignore sliced multibyte characters when reading metadata for sitemaps
  • Fix NameError caused by failed import in auto plugin.

Nikola v7.6.3 is out!

On behalf of the Nikola team, I am pleased to announce the immediate availability of Nikola v7.6.3. It fixes some bugs and adds new features.

What is Nikola?

Nikola is a static site and blog generator, written in Python. It can use Mako and Jinja2 templates, and input in many popular markup formats, such as reStructuredText and Markdown — and can even turn Jupyter (IPython) Notebooks into blog posts! It also supports image galleries, and is multilingual. Nikola is flexible, and page builds are extremely fast, courtesy of doit (which is rebuilding only what has been changed).

Find out more at the website: https://getnikola.com/

Downloads

Install using pip install Nikola or download tarballs on GitHub and PyPI.

Changes

Features

  • New translations: Serbian and Bosnian, by saleone
  • Added mechanism for rest extensions to depend on configuration options (Issue #1919)
  • Render Jupyter notebooks (ipynb) in listings (Issue #1900)

Bugfixes

  • Handle folders without trailing slashes in nikola auto (Issue #1933)
  • Set a base element to aid relative URL resolution, stripped on-the-fly when using the auto or serve command to view site locally. (Issue #1922)
  • Rebuild archives when post slugs and titles change (Issue #1931)
  • Handle special characters in URLs in nikola auto (Issue #1925)
  • Avoid Broken Pipe error in nikola auto (Issue #1906)
  • "nikola auto" serving implicit index.html with wrong mime type (Issue #1921)
  • Handle non-integer shutter speeds and other variables in WordPress importer (Issue #1917)

Coil CMS demo site is up!

We just created a demo site for Coil CMS, the simple CMS-like solution that lets users write content on a Nikola blog with ease.

You can now access:

What is Coil CMS?

Coil CMS is a basic CMS (with user management and a WYSIWYG HTML editor), which uses Nikola to generate the pages, combining the best of both worlds: you (or your editors) can easily create content, while the site is based on resilient static pages. Users don’t even have to know what Nikola, Python or static websites are. They just write their content. The only difference is that they (or someone with the necessary permissions) need to click a Rebuild button to make their changes show up on the website.

What is Nikola?

Nikola is a static site and blog generator, written in Python. It can use Mako and Jinja2 templates, and input in many popular markup formats, such as reStructuredText and Markdown — and can even turn Jupyter (IPython) Notebooks into blog posts! It also supports image galleries, and is multilingual. Nikola is flexible, and page builds are extremely fast, courtesy of doit (which is rebuilding only what has been changed).

6333 commits to Nikola (2012-2015), visualized

From Daniel Aleksandersen (Aeyoun), on the mailing list:

Nikola currently has more than 6333 commits (averaging at 5.2 commits per day!) from 121 contributors. That is a lot to wrap one’s mind around! I made is a visualization with gource to see the project activity using all the commits covering the period from the beginning of the project in 2012-03-31 all the way up to 2015-07-29.

Expand the description on YouTube to get clickable links to see the first commit from each of the top ten contributors (by commits, as tracked by GitHub).

Please all keep on making Nikola the best static site generator out there! A personal thank you to everyone who have contributed. You’ve all helped me build a website for myself that I’m really happy with. ^___^

Throughout the years, there were 112 contributors to Nikola, with a total of 49 releases. 1917 issues and PRs were opened, 1856 of which have been resolved.

And now: a blast from the past, the Nikola v1.1 demo site (available since the 5000 commits milestone):

Nikola v1.1 Demo Site

Nikola v7.6.2 is out!

On behalf of the Nikola team, I am pleased to announce the immediate availability of Nikola v7.6.2. It fixes some bugs and adds new features.

What is Nikola?

Nikola is a static site and blog generator, written in Python. It can use Mako and Jinja2 templates, and input in many popular markup formats, such as reStructuredText and Markdown — and can even turn Jupyter (IPython) Notebooks into blog posts! It also supports image galleries, and is multilingual. Nikola is flexible, and page builds are extremely fast, courtesy of doit (which is rebuilding only what has been changed).

Find out more at the website: https://getnikola.com/ (BTW, we totally rewrote the website, now it's modern and pretty!)

Downloads

Get it on GitHub and PyPI.

Changes

Features

  • Make the Google Search example prettier, integrating well with Bootstrap 3 (Issue #1912)
  • Add categories filter to post list directive (via Issue #1889)
  • Remove empty directories with nikola check --clean-files (Issue #1873)

Bugfixes

  • Don't assume things are HTML in auto mode (Issue #1915)
  • Don’t rebuild Atom syndication files unnecessarily often
  • Include .php files in sitemaps
  • Retry all client errors (4xx) to HEAD as GET request when checking remote links
  • Graceful fallback in nikola serve --detach on Windows (Issue #1913)
  • Don't auto-rebuild on changes to ".foo" or "foo~" or changes in folders
  • auto should also rebuild in response to move events
  • Don’t get metadata from file if compiler-specific metadata exist (Issue #1904)
  • Fix PRETTY_URLS prompt for Windows (Issue #1901)
  • Fix reST and Markdown title extraction from documents (Issue #1895, #1898)
  • Minor improvements to the extending document
  • Re-add the hack to kill nikola auto on ^C (Issue #1893)

Nikola 7.6.1 is out

On behalf of the Nikola team, I am pleased to announce the immediate availability of Nikola v7.6.1. It fixes some bugs and adds new features.

What is Nikola?

Nikola is a static site and blog generator, written in Python. It can use Mako and Jinja2 templates, and input in many popular markup formats, such as reStructuredText and Markdown — and can even turn Jupyter (IPython) Notebooks into blog posts! It also supports image galleries, and is multilingual. Nikola is flexible, and page builds are extremely fast, courtesy of doit (which is rebuilding only what has been changed).

Find out more at the website: https://getnikola.com/

Key Changes since v7.6.0

  • Many Wordpress importer improvements

  • Modern reST stylesheets, based in part on Bootstrap 3 (Issue #1150)

Downloads

Get it on GitHub and PyPI.

Changes

Features

  • Several improvements to WordPress importer (PR #1867):

    • Allowing to export categories and category hierarchy with --export-categories-as-categories

    • Allowing to exclude private posts, and allowing to include empty posts

    • Allowing to use HTTP authentication for downloads with --download-auth (PR #1848)

    • Allowing to export comments with --export-comments

    • Allowing to use WordPress page compiler to directly convert posts to HTML on import with --transform-to-html

    • Allowing to use WordPress page compiler on imported site instead of converting posts to markdown with --use-wordpress-compiler

    • Allowing to automatically install the WordPress page compiler when needed with --install-wordpress-compiler

    • Exporting information on attachments per post as JSON (#1867 and #1888)

    • Exporting post status and excerpt

  • New ‘pagekind’ variable available to identify different kind of pages from theme templates

  • Add --no-server option to nikola auto (Issue #1883)

  • Always return unicode in slugify (Issue #1885)

  • Remove logging handlers (Issue #1797)

  • Add -d, --detach option to nikola serve (Issue #1871)

  • Use provided teaser format (*_READ_MORE_LINK) with custom teaser text (Issue #1879)

  • Delete old bootstrap theme (use bootstrap3 instead)

  • Screen reader-friendly navbar collapses and dropdowns (Issue #1863)

  • Modern reST stylesheets, based in part on Bootstrap 3 (Issue #1150)

Bugfixes

  • Add missing xmlns:xhtml namespace to sitemaps (Issue #1890)

  • Fixed superfluous rebuild problems with Python 3. Note that this will cause rebuilds for most sites. (Issue #1887)

  • Fix links in sample post (Issue #1874)

  • Don't use deprecated Yapsy methods (Isue #1868)

  • Surpress wincing when auto is aborted during rebuilding

  • Show tags only from the current language on tag listing pages (Issue #1856)

  • Remove gap between line numbers and code (Issue #1859)

  • Fix spurious warnings about posts published in the future (Issue #1850)

Nikola v7.6.0 is out!

On behalf of the Nikola team, I am pleased to announce the immediate availability of Nikola v7.6.0. It fixes some bugs and adds new features.

What is Nikola?

Nikola is a static site and blog generator, written in Python. It can use Mako and Jinja2 templates, and input in many popular markup formats, such as reStructuredText and Markdown — and can even turn Jupyter (IPython) Notebooks into blog posts! It also supports image galleries, and is multilingual. Nikola is flexible, and page builds are extremely fast, courtesy of doit (which is rebuilding only what has been changed).

Find out more at the website: https://getnikola.com/

Key Changes since v7.5.1

  • nikola auto fixed for Python 3 and while rebuilding

  • nikola auto now uses watchdog and supports Windows

  • Support for Jupyter Notebooks: you can now use non-Python .ipynb files with Nikola (ipynb@KERNEL to pick a kernel)

  • Added nikola new_post -F to list available compilers

  • Better print CSS

  • Per-post filters via metadata

Downloads

Get it on GitHub and PyPI.

Changes

Features

  • Translate Write your post here. to default language (Issue #1621)

  • Enable PRETTY_URLS by default on new sites created by the wizard (Issue #1838)

  • Add -F, --available-compilers option to nikola new_post and nikola new_page (Issue #1837)

  • Add print CSS to all default themes (Issue #1817)

  • Support other kernels for ipynb/Jupyter using nikola new_post -f ipynb@kernel (Issues #1774, #1834)

  • Add distinct styling for the site footer in bootstrap3

  • Bootstrap v3.3.5 (Issue #1828)

  • Use watchdog in nikola auto (Issue #1810)

  • Add redirection for tags in Wordpress importer (Issue #1168)

  • Add support for html_tidy_withconfig to use a tidy5.conf file (Issue #1795)

  • Change default tidy5 filters not to drop empty elements (Issue #1795)

  • Apply per-post filters via metadata (Issue #914)

Bugfixes

  • Nikola auto was broken in python 3 (Issue #1830)

  • Read configuration when importing into an existing site (Issue #1823)

  • Don’t crash on non-UTF-8 files during sitemap generation (Issue #1842)

  • Unnecessary rebuilds of yearly archives (Issue #1833)

  • Quietly ignore non-existent files in nikola check -l (Issue #1831)

  • Don’t rebuild all tag or category pages when changing tag/category descriptions

  • Fix crash in wordpress code importer (Issue #1819)

  • Call correct command in nikola auto