.. title: Author pages in Nikola v7.7.0
.. author: Juanjo Conti
.. slug: author-pages-in-nikola-v770
.. date: 2015-09-04 12:40:00 UTC-03:00
.. tags: nikola, authors
.. category: Features
.. link:
.. description:
.. type: text
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:
.. code-block:: python
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:
.. code-block:: python
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):
.. code-block:: python
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):
.. code-block:: mako
% if author_pages_generated:
${post.author()}
% 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/