Skip to content
Permalink
Browse files
Nikola v7.8.1
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Oct 13, 2016
1 parent 6b15a59 commit d80d3be916c7aa3fc4faa53952b7238409903bab
@@ -50,6 +50,7 @@
# fi Finnish
# fr French
# gl Galician
# he Hebrew
# hi Hindi
# hr Croatian
# hu Hungarian
@@ -76,6 +77,7 @@
# uk Ukrainian
# ur Urdu
# zh_cn Chinese (Simplified)
# zh_tw Chinese (Traditional)
#
# If you want to use Nikola with a non-supported language you have to provide
# a module containing the necessary translations
@@ -178,9 +180,9 @@
("posts/*.html", "posts", "post.tmpl"),
)
PAGES = (
("stories/*.rst", "stories", "story.tmpl"),
("stories/*.txt", "stories", "story.tmpl"),
("stories/*.html", "stories", "story.tmpl"),
("pages/*.rst", "pages", "story.tmpl"),
("pages/*.txt", "pages", "story.tmpl"),
("pages/*.html", "pages", "story.tmpl"),
)


@@ -688,11 +690,23 @@
# Embedded thumbnail information:
# EXIF_WHITELIST['1st'] = ["*"]

# Folders containing images to be used in normal posts or pages. Images will be
# scaled down according to IMAGE_THUMBNAIL_SIZE and MAX_IMAGE_SIZE options, but
# will have to be referenced manually to be visible on the site
# Folders containing images to be used in normal posts or pages.
# IMAGE_FOLDERS is a dictionary of the form {"source": "destination"},
# where "source" is the folder containing the images to be published, and
# "destination" is the folder under OUTPUT_PATH containing the images copied
# to the site. Thumbnail images will be created there as well.

# To reference the images in your posts, include a leading slash in the path.
# For example, if IMAGE_FOLDERS = {'images': 'images'}, write
#
# ..image:: /images/tesla.jpg
#
# See the Nikola Handbook for details (in the “Embedding Images” and
# “Thumbnails” sections)

# Images will be scaled down according to IMAGE_THUMBNAIL_SIZE and MAX_IMAGE_SIZE
# options, but will have to be referenced manually to be visible on the site
# (the thumbnail has ``.thumbnail`` added before the file extension).
# The format is a dictionary of {source: relative destination}.

IMAGE_FOLDERS = {'images': 'images'}
# IMAGE_THUMBNAIL_SIZE = 400
@@ -880,13 +894,13 @@
# the "noannotations" metadata.
# ANNOTATIONS = False

# Create index.html for page (story) folders?
# Create index.html for page folders?
# WARNING: if a page would conflict with the index file (usually
# caused by setting slug to `index`), the STORY_INDEX
# caused by setting slug to `index`), the PAGE_INDEX
# will not be generated for that directory.
# STORY_INDEX = False
# Enable comments on story pages?
# COMMENTS_IN_STORIES = False
# PAGE_INDEX = False
# Enable comments on pages (i.e. not posts)?
# COMMENTS_IN_PAGES = False
# Enable comments on picture gallery pages?
# COMMENTS_IN_GALLERIES = False

@@ -964,9 +978,20 @@
# it's faster and the output looks better.
# If you set USE_KATEX to True, you also need to add an extra CSS file
# like this:
# EXTRA_HEAD_DATA = """<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css">"""
# EXTRA_HEAD_DATA = """<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css">"""
# USE_KATEX = False

# If you want to use the old (buggy) inline math $.$ with KaTeX, then
# you might want to use this feature.
# KATEX_AUTO_RENDER = """
# delimiters: [
# {left: "$$", right: "$$", display: true},
# {left: "\\\[", right: "\\\]", display: true},
# {left: "$", right: "$", display: false},
# {left: "\\\(", right: "\\\)", display: false}
# ]
# """

# Do you want to customize the nbconversion of your IPython notebook?
# IPYNB_CONFIG = {}
# With the following example configuration you can use a custom jinja template
@@ -0,0 +1,59 @@
.. title: Nikola v7.8.1 is out!
.. slug: nikola-v781-is-out
.. date: 2016-10-13 18:19:43 UTC
.. tags: nikola, planet, python, programming, release
.. category:
.. link:
.. description:
.. type: text
.. author: Chris Warrick

On behalf of the Nikola team, I am pleased to announce the immediate
availability of Nikola v7.8.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/

Downloads
=========

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

__ https://github.com/getnikola/nikola/releases/tag/v7.8.1
__ https://pypi.python.org/pypi/Nikola/7.8.1

Changes
=======

Bugfixes
--------

* Rename ``stories`` to ``pages`` in most of the codebase (Issue
#1891)
* Report missing/unknown dates in posts with filenames
(Issues #2505, #2506)
* Report filename of post that raised exception when scanning
(Issue #2505)
* Accept ``page`` and ``pages`` for the ``type`` field in post lists
* Don’t crash if a post list has no posts (Issue #2489)

Features
--------

* Add Hebrew translation by Yitzhak Bar Geva
* Add Chinese (Traditional) ``zh_TW`` translation by Po-Wen Chi
* Add ``nikola theme --list-installed`` (Issue #2504)
* Add ``KATEX_AUTO_RENDER`` setting to configure math delimiters
* Update KaTeX version to 0.6.0: support aligned math display
* Better support for a tree of files in ``data/``
@@ -1,3 +1,3 @@
{
"last_deploy": "2016-09-01T13:41:11.949479"
"last_deploy": "2016-10-13T18:29:26.991693"
}
@@ -17,6 +17,7 @@
* `Casey M. Bessette <https://github.com/caseybessette>`_
* `Chris Lee <https://github.com/clee>`_
* `Chris Warrick <https://github.com/Kwpolska>`_
* `Christian Lawson-Perfect <https://github.com/christianp>`_
* `Christopher Arndt <https:/github.com/SpotlightKid>`_
* `Claudio Canepa <https://github.com/ccanepa>`_
* `Damien Tournoud <https://github.com/damz>`_
@@ -31,6 +32,7 @@
* `Dhruv Baldawa <https://github.com/dhruvbaldawa>`_
* `Dirk Engling <https://github.com/erdgeist>`_
* `Dmitry Verkhoturov <https://github.com/paskal>`_
* `Du Phan <https://github.com/fehiepsi>`_
* `Duncan Lock <https://github.com/dflock>`_
* `Edinei Cavalcanti <https://github.com/neiesc>`_
* `Eduardo Schettino <https://github.com/schettino72>`_
@@ -1,3 +1,28 @@
New in v7.8.1
=============

Bugfixes
--------

* Rename ``stories`` to ``pages`` in most of the codebase (Issue
#1891)
* Report missing/unknown dates in posts with filenames
(Issues #2505, #2506)
* Report filename of post that raised exception when scanning
(Issue #2505)
* Accept ``page`` and ``pages`` for the ``type`` field in post lists
* Don’t crash if a post list has no posts (Issue #2489)

Features
--------

* Add Hebrew translation by Yitzhak Bar Geva
* Add Chinese (Traditional) ``zh_TW`` translation by Po-Wen Chi
* Add ``nikola theme --list-installed`` (Issue #2504)
* Add ``KATEX_AUTO_RENDER`` setting to configure math delimiters
* Update KaTeX version to 0.6.0: support aligned math display
* Better support for a tree of files in ``data/``

New in v7.8.0
=============

@@ -1,11 +1,11 @@
.. title: Nikola v7.8.0 configuration file
.. title: Nikola v7.8.1 configuration file
.. slug: conf
.. date: 2014-11-08 18:51:30 UTC
.. description: The Nikola configuration file.
.. type: text
.. author: The Nikola Team

The default config file for Nikola v7.8.0 is reproduced below.
The default config file for Nikola v7.8.1 is reproduced below.

.. raw:: html

@@ -51,9 +51,9 @@ configuration file:
POSTS = ()
# you can also keep the current content of POSTS if you want a blog with your site
PAGES = (
("stories/*.rst", "", "story.tmpl"),
("stories/*.txt", "", "story.tmpl"),
("stories/*.html", "", "story.tmpl"),
("pages/*.rst", "", "story.tmpl"),
("pages/*.txt", "", "story.tmpl"),
("pages/*.html", "", "story.tmpl"),
)

# And to avoid a conflict because blogs try to generate /index.html
@@ -70,7 +70,7 @@ And now we are ready to create our first page:

Title: index
Scanning posts....done!
[1970-01-01T00:00:00Z] INFO: new_page: Your page's text is at: stories/index.rst
[1970-01-01T00:00:00Z] INFO: new_page: Your page's text is at: pages/index.rst

We can now build and preview our site:

@@ -104,7 +104,7 @@ So, what’s in that ``pages/index.txt`` file?

``title`` is the page title, ``slug`` is the name of the generated HTML file
(in this case it would be ``index.html``). ``date``, ``tags`` and ``link``
doesn’t matter at all in stories. ``description`` is useful for SEO purposes
doesn’t matter at all in pages. ``description`` is useful for SEO purposes
if you care for that.

And below, the content. By default Nikola uses
@@ -74,7 +74,7 @@ First, we create a site with some content in it. We’ll use the ``nikola init``
Creating Nikola Site
====================

This is Nikola v7.4.1. We will now ask you a few easy questions about your new site.
This is Nikola v7.8.0. We will now ask you a few easy questions about your new site.
If you do not want to answer and want to go with the defaults instead, simply restart with the `-q` parameter.
--- Questions about the site ---
Site title [My Nikola Site]:
@@ -107,12 +107,10 @@ First, we create a site with some content in it. We’ll use the ``nikola init``


Then, we create an empty theme inheriting from base. This theme will use Mako templates. If you prefer Jinja2,
then you should use ``base-jinja`` instead::
then you should use ``base-jinja`` as a parent and ``jinja`` as engine instead::

$ cd lanyon-port/
$ mkdir themes
$ mkdir themes/lanyon
$ echo base > themes/lanyon/parent
$ nikola theme -n lanyon --parent base --engine mako

Edit ``conf.py`` and set ``THEME = 'lanyon'``. Also set ``USE_BUNDLES = False`` (just do it for now, we’ll get to bundles later).

@@ -207,11 +205,11 @@ But how do I tell **our** lanyon theme to use those CSS files instead of whateve
By giving our theme its own base_helper.tmpl.

That file is a **template** used to generate parts of the pages. It’s large and
complicated but we don’t need to change a lot of it. First, get it from
`Nikola’s source code <https://github.com/getnikola/nikola/blob/master/nikola/data/themes/base/templates/base_helper.tmpl>`__ and put a copy in ``themes/lanyon/templates/base_helper.tmpl``::
complicated but we don’t need to change a lot of it. First, make a copy in your
theme (note this command requires setting your ``THEME`` in ``conf.py`` to
``lanyon``)::

$ mkdir themes/lanyon/templates
$ curl https://raw.githubusercontent.com/getnikola/nikola/master/nikola/data/themes/base/templates/base_helper.tmpl > themes/lanyon/templates/base_helper.tmpl
$ nikola theme -c base_helper.tmpl

The part we want to change is this:

@@ -9,7 +9,7 @@
Extending Nikola
================

:Version: 7.8.0
:Version: 7.8.1
:Author: Roberto Alsina <ralsina@netmanagers.com.ar>

.. class:: alert alert-info pull-right
@@ -470,7 +470,7 @@ from ``super()``. Example plugin: `navstories <https://github.com/getnikola/plu
PostScanner Plugins
-------------------

Get posts and stories from "somewhere" to be added to the timeline.
Get posts and pages from "somewhere" to be added to the timeline.
The only currently existing plugin of this kind reads them from disk.


@@ -642,16 +642,22 @@ handler function, ``site`` and ``data`` will be added to the keyword arguments.

Example:

The following shortcode::
The following shortcode:

.. code:: text

{{% raw %}}{{% foo bar="baz" spam %}}{{% /raw %}}

With a template in ``shortcodes/foo.tmpl`` with this content (using Jinja2
syntax in this example)::
syntax in this example)

.. code:: jinja

<div class="{{ _args[0] if _args else 'ham' }}">{{ bar }}</div>

Will result in this output::
Will result in this output

.. code:: html

<div class="spam">baz</div>

@@ -661,8 +667,8 @@ State and Cache

Sometimes your plugins will need to cache things to speed up further actions. Here are the conventions for that:

* If it's a file, put it somewhere in ```self.site.config['CACHE_FOLDER']``` (defaults to ```cache/```.
* If it's a value, use ```self.site.cache.set(key, value)``` to set it and ```self.site.cache.get(key)``` to get it.
* If it's a file, put it somewhere in ``self.site.config['CACHE_FOLDER']`` (defaults to ``cache/``.
* If it's a value, use ``self.site.cache.set(key, value)`` to set it and ``self.site.cache.get(key)`` to get it.
The key should be a string, the value should be json-encodable (so, be careful with datetime objects)

The values and files you store there can **and will** be deleted sometimes by the user. They should always be
@@ -672,11 +678,11 @@ On the other hand, sometimes you want to save something that is **not** a throwa
change the output, so the user should not delete them. We call that **state**. To save state:

* If it's a file, put it somewhere in the working directory. Try not to do that please.
* If it's a value, use ```self.site.state.set(key, value)``` to set it and ```self.state.cache.get(key)``` to get it.
* If it's a value, use ``self.site.state.set(key, value)`` to set it and ``self.state.cache.get(key)`` to get it.
The key should be a string, the value should be json-encodable (so, be careful with datetime objects)

The ```cache``` and ```state``` objects are rather simplistic, and that's intentional. They have no default values: if
the key is not there, you will get ```None``` and like it. They are meant to be both threadsafe, but hey, who can
The ``cache`` and ``state`` objects are rather simplistic, and that's intentional. They have no default values: if
the key is not there, you will get ``None`` and like it. They are meant to be both threadsafe, but hey, who can
guarantee that sort of thing?

There are no sections, and no access protection, so let's not use it to store passwords and such. Use responsibly.
@@ -88,14 +88,14 @@ one of the existing ones.
You can do doctests, you can do unit tests, you can do integration tests. There is support
for all of them.

Posts and Stories
-----------------
Posts and Pages
---------------

Nikola has a concept of posts and stories. Both are more or less the same thing, except
posts are added into RSS feeds and stories are not. All of them are in a list called
Nikola has a concept of posts and pages. Both are more or less the same thing, except
posts are added into RSS feeds and pages are not. All of them are in a list called
"the timeline" formed by objects of class ``Post``.

When you are creating a task that needs the list of posts and/or stories (for example,
When you are creating a task that needs the list of posts and/or pages (for example,
the RSS creation plugin) on task execution time, your plugin should call ``self.site.scan_posts()``
in ``gen_tasks`` to ensure the timeline is created and available in
``self.site.timeline``. You should not modify the timeline, because it will cause consistency issues.

0 comments on commit d80d3be

Please sign in to comment.