Skip to content
Permalink
Browse files

Nikola v7.8.6

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 26, 2017
1 parent 2e692c2 commit 0d360a03d8c278b330ff0999736a3a0d395c4097
@@ -177,8 +177,8 @@
# Finally, note that destination can be translated, i.e. you can
# specify a different translation folder per language. Example:
# PAGES = (
# ("pages/*.rst", {"en": "pages", "de": "seiten"}, "story.tmpl"),
# ("pages/*.md", {"en": "pages", "de": "seiten"}, "story.tmpl"),
# ("pages/*.rst", {"en": "pages", "de": "seiten"}, "page.tmpl"),
# ("pages/*.md", {"en": "pages", "de": "seiten"}, "page.tmpl"),
# )

POSTS = (
@@ -187,9 +187,9 @@
("posts/*.html", "posts", "post.tmpl"),
)
PAGES = (
("pages/*.rst", "pages", "story.tmpl"),
("pages/*.txt", "pages", "story.tmpl"),
("pages/*.html", "pages", "story.tmpl"),
("pages/*.rst", "pages", "page.tmpl"),
("pages/*.txt", "pages", "page.tmpl"),
("pages/*.html", "pages", "page.tmpl"),
)


@@ -663,7 +663,17 @@
# (defaults to 'tidy5').
# HTML_TIDY_EXECUTABLE = 'tidy5'

# List of XPath expressions which should be used for finding headers
# ({hx} is replaced by headers h1 through h6).
# You must change this if you use a custom theme that does not use
# "e-content entry-content" as a class for post and page contents.
# HEADER_PERMALINKS_XPATH_LIST = ['*//div[@class="e-content entry-content"]//{hx}']
# Include *every* header (not recommended):
# HEADER_PERMALINKS_XPATH_LIST = ['*//{hx}']

# File blacklist for header permalinks. Contains output path
# (eg. 'output/index.html')
# HEADER_PERMALINKS_FILE_BLACKLIST = []

# Expert setting! Create a gzipped copy of each generated file. Cheap server-
# side optimization for very high traffic sites or low memory servers.
@@ -898,6 +908,8 @@
# tuples of tuples of positional arguments and dicts of keyword arguments
# to format(). For example, {'en': (('Hello'), {'target': 'World'})}
# results in CONTENT_FOOTER['en'].format('Hello', target='World').
# If you need to use the literal braces '{' and '}' in your footer text, use
# '{{' and '}}' to escape them (str.format is used)
# WARNING: If you do not use multiple languages with CONTENT_FOOTER, this
# still needs to be a dict of this format. (it can be empty if you
# do not need formatting)
@@ -1046,7 +1058,7 @@
# Note: most Nikola-specific extensions are done via the Nikola plugin system,
# with the MarkdownExtension class and should not be added here.
# The default is ['fenced_code', 'codehilite']
MARKDOWN_EXTENSIONS = ['fenced_code', 'codehilite', 'extra']
MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code', 'markdown.extensions.codehilite', 'markdown.extensions.extra']

# Extra options to pass to the pandoc command.
# by default, it's empty, is a list of strings, for example
@@ -0,0 +1,73 @@
.. title: Nikola v7.8.6 is out!
.. slug: nikola-v786-is-out
.. date: 2017-05-26 13:49:38 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.6. 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`__.

Or if you prefer, Snapcraft packages are now built automatically, and Nikola v7.8.6 will be available in the stable channel.

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

Changes
=======

Features
--------

* Guess file format from file name on new_post (Issue #2798)
* Use BaguetteBox as lightbox in base theme (Issue #2777)
* New ``deduplicate_ids`` filter, for preventing duplication of HTML
``id`` attributes (Issue #2570)
* Ported gallery image layout to base theme (Issue #2775)
* Better error handling when posts can't be parsed (Issue #2771)
* Use ``.theme`` files to store theme metadata (Issue #2758)
* New ``add_header_permalinks`` filter, for Sphinx-style header links
(Issue #2636)
* Added alternate links for gallery translations (Issue #993)

Bugfixes
--------

* Use ``locale.getdefaultlocale()`` for better locale guessing
(credit: @madduck)
* Save dependencies for template hooks properly (using ``.__doc__`` or
``.template_registry_identifier`` for callables)
* Enable larger panorama thumbnails (Issue #2780)
* Disable ``archive_rss`` link handler, which was useless because no
such RSS was ever generated (Issue #2783)
* Ignore files ending wih "bak" (Issue #2740)
* Use page.tmpl by default, which is inherited from story.tmpl (Issue
#1891)

Other
-----

* Limit Jupyter support to notebook >= 4.0.0 (it already was in
requirements-extras.txt; Issue #2733)
@@ -1,3 +1,3 @@
{
"last_deploy": "2017-05-26T12:55:06.589929"
"last_deploy": "2017-05-26T13:57:34.392951"
}
@@ -1,3 +1,40 @@
New in v7.8.6
=============

Features
--------

* Guess file format from file name on new_post (Issue #2798)
* Use BaguetteBox as lightbox in base theme (Issue #2777)
* New ``deduplicate_ids`` filter, for preventing duplication of HTML
``id`` attributes (Issue #2570)
* Ported gallery image layout to base theme (Issue #2775)
* Better error handling when posts can't be parsed (Issue #2771)
* Use ``.theme`` files to store theme metadata (Issue #2758)
* New ``add_header_permalinks`` filter, for Sphinx-style header links
(Issue #2636)
* Added alternate links for gallery translations (Issue #993)

Bugfixes
--------

* Use ``locale.getdefaultlocale()`` for better locale guessing
(credit: @madduck)
* Save dependencies for template hooks properly (using ``.__doc__`` or
``.template_registry_identifier`` for callables)
* Enable larger panorama thumbnails (Issue #2780)
* Disable ``archive_rss`` link handler, which was useless because no
such RSS was ever generated (Issue #2783)
* Ignore files ending wih "bak" (Issue #2740)
* Use page.tmpl by default, which is inherited from story.tmpl (Issue
#1891)

Other
-----

* Limit Jupyter support to notebook >= 4.0.0 (it already was in
requirements-extras.txt; Issue #2733)

New in v7.8.5
=============

@@ -1,11 +1,11 @@
.. title: Nikola v7.8.5 configuration file
.. title: Nikola v7.8.6 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.5 is reproduced below.
The default config file for Nikola v7.8.6 is reproduced below.

.. raw:: html

@@ -115,6 +115,7 @@ then you should use ``base-jinja`` as a parent and ``jinja`` as engine instead::
$ 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).
Also, if you intend to publish your theme on the Index, or want to use it with older versions (v7.8.5 or older), use the ``--legacy-meta`` option for ``nikola theme -n``.

You can now build that site using ``nikola build`` and it will look like this:

@@ -824,4 +825,4 @@ The End

And that’s it, that’s a whole theme. Eventually, once people start using it, they will notice small broken details, which will need handling one at a time.

This theme should be available in http://themes.getnikola.com#lanyon and you can see it in action at https://themes.getnikola.com/v7/lanyon/index.html
This theme should be available in http://themes.getnikola.com/v7/lanyon/ and you can see it in action at https://themes.getnikola.com/v7/lanyon/demo/ .
@@ -9,7 +9,7 @@
Extending Nikola
================

:Version: 7.8.5
:Version: 7.8.6
:Author: Roberto Alsina <ralsina@netmanagers.com.ar>

.. class:: alert alert-info pull-right
@@ -537,21 +537,22 @@ HTML:

# In set_site
def generate_html_bit(name, ftype='js'):
"""Generate HTML for an asset."""
return '<script src="/assets/{t}/{n}.{t}">'.format(n=name, t=ftype)

site.template_hooks['extra_head'].append(generate_html_bit, False, 'fancyplugin', type='js')
site.template_hooks['extra_head'].append(generate_html_bit, False, 'fancyplugin', ftype='js')


The second argument to ``append()`` is used to determine whether the function
needs access to the current template context and the site. If it is set to
``True``, the function will also receive ``site`` and ``context`` keyword
arguments. Example use:


.. code-block:: python

# In set_site
def greeting(addr, endswith='', site=None, context=None):
"""Greet someone."""
if context['lang'] == 'en':
greet = u'Hello'
elif context['lang'] == 'es':
@@ -564,6 +565,13 @@ arguments. Example use:

site.template_hooks['page_header'].append(greeting, True, u'Nikola Tesla', endswith=u'!')

Dependencies for template hooks:

* if the input is a string, the string value, alongside arguments to ``append``, is used for calculating dependencies
* if the input is a callable, it attempts ``input.template_registry_identifier``, then ``input.__doc__``, and if neither is available, it uses a static string.

Make sure to provide at least a docstring, or a identifier, to ensure rebuilds work properly.

Shortcodes
==========

@@ -579,7 +587,7 @@ So, if you are creating a plugin that generates markup, it may be a good idea
to register it as a shortcode in addition of to restructured text directive or
markdown extension, thus making it available to all markup formats.

To implement your own shortcodes from a plugin, you can create a plugin inheriting ``ShortcodePlugin`` and
To implement your own shortcodes from a plugin, you can create a plugin inheriting ``ShortcodePlugin`` and
from its ``set_site`` method, call

``Nikola.register_shortcode(name, func)`` with the following arguments:
@@ -610,7 +618,7 @@ variable keyword arguments):
between them, otherwise ``None``.

``lang``:
The current language.
The current language.

If the shortcode tag has arguments of the form ``foo=bar`` they will be
passed as named arguments. Everything else will be passed as positional
@@ -9,7 +9,7 @@
The Nikola Handbook
===================

:Version: 7.8.5
:Version: 7.8.6

.. class:: alert alert-info pull-right

@@ -1940,6 +1940,66 @@ jsonminify
xmlminify
Minify XML files. Suitable for Nikola’s sitemaps and Atom feeds.

add_header_permalinks
Add links next to every header, Sphinx-style. You will need to add styling for the `headerlink` class,
in `custom.css`, for example:

.. code:: css

/* Header permalinks */
h1:hover .headerlink, h2:hover .headerlink,
h3:hover .headerlink, h4:hover .headerlink,
h5:hover .headerlink, h6:hover .headerlink {
display: inline;
}

.headerlink {
display: none;
color: #ddd;
margin-left: 0.2em;
padding: 0 0.2em;
}

.headerlink:hover {
opacity: 1;
background: #ddd;
color: #000;
text-decoration: none;
}

Additionally, you can provide a custom list of XPath expressions which should be used for finding headers (``{hx}`` is replaced by headers h1 through h6).
This is required if you use a custom theme that does not use ``"e-content entry-content"`` as a class for post and page contents.

.. code:: python
# Default value:
HEADER_PERMALINKS_XPATH_LIST = ['*//div[@class="e-content entry-content"]//{hx}']
# Include *every* header (not recommended):
# HEADER_PERMALINKS_XPATH_LIST = ['*//{hx}']


deduplicate_ids
Prevent duplicated IDs in HTML output. An incrementing counter is added to
offending IDs. If used alongside ``add_header_permalinks``, it will fix
those links (it must run **after** that filter)

IDs are numbered from the bottom up, which is useful for indexes (updates
appear at the top). There are exceptions, which may be configured using
``DEDUPLICATE_IDS_TOP_CLASSES`` — if any of those classes appears sin the
document, the IDs are rewritten top-down, which is useful for posts/pages
(updates appear at the bottom).

Note that in rare cases, permalinks might not always be *permanent* in case
of edits.

.. code:: python

DEDUPLICATE_IDS_TOP_CLASSES = ('postpage', 'storypage')

You can also use a file blacklist (``HEADER_PERMALINKS_FILE_BLACKLIST``),
useful for some index pages. Paths include the output directory (eg.
``output/index.html``)


You can apply filters to specific posts or pages by using the ``filters`` metadata field:

.. code:: restructuredtext
@@ -17,19 +17,12 @@ archive
link://archive/2013 => /archives/2013/index.html

archive_atom
Link to archive Atom path, name is the year.
Link to archive Atom path, name is the year (archive pages must be indexes).

Example:

link://archive_atom/2013 => /archives/2013/index.atom

archive_rss
Link to archive RSS path, name is the year.

Example:

link://archive_rss/2013 => /archives/2013/rss.xml

author
Link to an author's page.

@@ -9,7 +9,7 @@
Using Alternative Social Buttons with Nikola
============================================

:Version: 7.8.5
:Version: 7.8.6

.. class:: alert alert-info pull-right

@@ -4,7 +4,7 @@
.. description: Get help using Nikola, or contact us.
.. author: The Nikola Team
:Version: 7.8.5
:Version: 7.8.6

.. class:: alert alert-info pull-right

0 comments on commit 0d360a0

Please sign in to comment.
You can’t perform that action at this time.