Skip to content

Commit

Permalink
Nikola v8.0.0b3
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Aug 7, 2018
1 parent 2b039cd commit 4dbcf5b
Show file tree
Hide file tree
Showing 13 changed files with 210 additions and 40 deletions.
22 changes: 6 additions & 16 deletions listings/conf.py
Expand Up @@ -239,11 +239,12 @@
# FORCE_ISO8601 = False

# Date format used to display post dates. (translatable)
# (str used by datetime.datetime.strftime)
# DATE_FORMAT = '%Y-%m-%d %H:%M'
# Used by babel.dates, CLDR style: http://cldr.unicode.org/translation/date-time
# You can also use 'full', 'long', 'medium', or 'short'
# DATE_FORMAT = 'YYYY-MM-dd HH:mm'

# Date format used to display post dates, if local dates are used. (translatable)
# (str used by moment.js)
# Used by moment.js: https://momentjs.com/docs/#/displaying/format/
# JS_DATE_FORMAT = 'YYYY-MM-DD HH:mm'

# Date fanciness.
Expand All @@ -255,20 +256,9 @@
# Your theme must support it, Bootstrap already does.
# DATE_FANCINESS = 0

# While Nikola can select a sensible locale for each language,
# sometimes explicit control can come handy.
# In this file we express locales in the string form that
# python's locales will accept in your OS, by example
# "en_US.utf8" in Unix-like OS, "English_United States" in Windows.
# LOCALES = dict mapping language --> explicit locale for the languages
# in TRANSLATIONS. You can omit one or more keys.
# LOCALE_FALLBACK = locale to use when an explicit locale is unavailable
# LOCALE_DEFAULT = locale to use for languages not mentioned in LOCALES; if
# not set the default Nikola mapping is used.

# Customize the locale/region used for a language.
# For example, to use British instead of US English: LOCALES = {'en': 'en_GB'}
# LOCALES = {}
# LOCALE_FALLBACK = None
# LOCALE_DEFAULT = None

# One or more folders containing files to be copied as-is into the output.
# The format is a dictionary of {source: relative destination}.
Expand Down
63 changes: 63 additions & 0 deletions posts/nikola-v800b3-is-out.txt
@@ -0,0 +1,63 @@
.. title: Nikola v8.0.0b3 is out!
.. slug: nikola-v800b3-is-out
.. date: 2018-08-07 16:44:34 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 v8.0.0b3. This is the third and hopefully final
beta of Nikola v8. The big change in this release is the adoption of
Babel to handle date translations (instead of relying on system locale,
which didn’t work well for us). Other issues and bugs were fixed.

Many themes in our Index have been ported for Nikola v8, but some of
them are not yet there.

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 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==8.0.0b3``.

If you want to upgrade to Nikola v8, make sure to read `the Upgrading blog post <https://getnikola.com/blog/upgrading-to-nikola-v8.html>`_.

Changes
=======

Features
--------

* New data_file option for chart shortcode and directive (Issue #3129)
* Show the filename of the missing file when ``nikola serve`` can't
find a file (i.e. when an 404 error occurs).
* Better error messages for JSON download failures in ``nikola
plugin`` and ``nikola theme`` (Issue getnikola/plugins#282)
* Use Babel instead of the locale module to better handle
localizations (Issues #2606, #3121)
* Change ``DATE_FORMAT`` formats to CLDR formats (Issue #2606)

Bugfixes
--------

* Fix listing installed themes if theme directory is missing.
* Watch correct output folder in ``nikola auto`` (Issue #3119)
* Fix post fragment dependencies when posts are only available in a
non-default language (Issue #3112)
* Implement ``MARKDOWN_EXTENSION_CONFIGS`` properly (Issue #2970)
* Ignore ``.DS_Store`` when processing listings (Issue #3099)
* Remove redundant check for tag similarity (Mentioned in Issue #3123)
64 changes: 62 additions & 2 deletions posts/upgrading-to-nikola-v8.txt
Expand Up @@ -7,7 +7,7 @@
.. description: How to upgrade to Nikola v8? This is a list of all things you need to take care of first.
.. type: text
.. author: Chris Warrick
.. updated: 2018-05-13 17:00:00
.. updated: 2018-07-07 17:40:00

.. class:: lead

Expand All @@ -21,6 +21,8 @@ a few manual changes are required to upgrade.
Revisions to this document
==========================

**2018-07-07:** Beta 3: Babel and changes to i18n

**2018-05-13:** Beta 2: bootblog4 has featured posts, zen modernized; one new backwards
incompatible change found and described (``reference`` replaces
``image-reference`` in thumbnails)
Expand All @@ -34,7 +36,7 @@ How to upgrade

1. Upgrade to the latest v7 version: ``pip install Nikola==7.8.15`` and make sure
there are no outstanding warnings.
2. Upgrade to v8: ``pip install -U --upgrade-strategy=eager Nikola==8.0.0b2``
2. Upgrade to v8: ``pip install -U --upgrade-strategy=eager Nikola==8.0.0b3``
3. Read the upgrade notes below and `the full changelog`__
4. Upgrade all third-party plugins and themes. (``nikola plugin --upgrade``,
``nikola theme --upgrade``)
Expand Down Expand Up @@ -111,6 +113,64 @@ Please make sure you’ve taken care of them before deploying.
* **(added 2018-05-10)** You need ``<a class="reference">`` (instead of
``image-reference``) to activate the lightbox now

Babel and i18n changes (added 2018-08-07)
=========================================

For a long time, Nikola’s i18n features depended on the system locale support.
That led to a bunch of issues and strange bugs. We’ve replaced this with the Babel
library. New features include:

* more flexible date formatting
* no more strange bugs related to system locale configuration
* translated dates even if system support was not there
(eg. on Alpine Linux, cf. discussion on issue #2606)
* proper forms for some Slavic languages (eg. marzec vs marca)

DATE_FORMAT changed
-------------------

DATE_FORMAT uses different tokens. If you customized ``DATE_FORMAT``, you need
to change it to use `CLDR formats
<http://cldr.unicode.org/translation/date-time>`_. (Hint: the new default value
is ``YYYY-MM-dd HH:mm``)

babeldates plugin obsoleted, LocaleBorg internal API changed
------------------------------------------------------------

The babeldates plugin is obsoleted by the changes. If you were using it, rename
``BABEL_DATE_FORMAT`` to ``DATE_FORMAT`` and remove the plugin.

In addition, the LocaleBorg extension API was simplified. The new API expects
extension authors to create functions matching the signatured and assign them
to the following names:

* ``LocaleBorg.datetime_formatter(date, date_format, lang, locale)``
* ``LocaleBorg.in_string_formatter(date, mode, custom_format, lang, locale)``

Translation help wanted
-----------------------

However, this means that we needed to reorganize translations. In order
to have things in a working state, I used some guessworks and tried to
produce a working form. However, not all languages will have
grammatically correct output at this point. This is why we need help
from our community around the world.

So, if you have the time, please help us check if our translations (on
`Transifex <https://www.transifex.com/ralsina/nikola/dashboard/>`_
or `GitHub <https://github.com/getnikola/nikola/tree/master/nikola/data/themes/base/messages>`_) are correct. Specifically, we need to know
if the date tags (in “Posts for XX” messages) are correctly placed. We
also need to know if the translation for those fits the required form.
To find out, you can run the `test script <https://gist.github.com/Kwpolska/3c0d1af8bd641229d4ab64f1b98d88de>`_ and check how all the forms
look for your locale. If they don't fit, they can be overridden:
for example, Polish uses “Posty z {month_year:MMMM yyyy}” and takes
advantage of the last bullet point.

As a bonus, the use of Babel means that it's even easier to use
"human-friendly" dates on your blog — try setting ``DATE_FORMAT = 'long'``
on Nikola master. (If you have customized that setting, you will need
to change it to use CLDR-style date formats.)

Removed and renamed settings
============================

Expand Down
2 changes: 1 addition & 1 deletion state_data.json
@@ -1,3 +1,3 @@
{
"last_deploy": "2018-05-19T10:13:31.548336"
"last_deploy": "2018-08-07T16:54:07.983341"
}
29 changes: 28 additions & 1 deletion stories/CHANGES.txt
@@ -1,8 +1,35 @@
New in v8.0.0b2 (changes since Beta 1)
New in v8.0.0b3 (changes since Beta 2)
======================================

.. to be merged into one "new in v8.0.0" entry later
Features
--------

* New data_file option for chart shortcode and directive (Issue #3129)
* Show the filename of the missing file when ``nikola serve`` can't
find a file (i.e. when an 404 error occurs).
* Better error messages for JSON download failures in ``nikola
plugin`` and ``nikola theme`` (Issue getnikola/plugins#282)
* Use Babel instead of the locale module to better handle
localizations (Issues #2606, #3121)
* Change ``DATE_FORMAT`` formats to CLDR formats (Issue #2606)

Bugfixes
--------

* Fix listing installed themes if theme directory is missing.
* Watch correct output folder in ``nikola auto`` (Issue #3119)
* Fix post fragment dependencies when posts are only available in a
non-default language (Issue #3112)
* Implement ``MARKDOWN_EXTENSION_CONFIGS`` properly (Issue #2970)
* Ignore ``.DS_Store`` when processing listings (Issue #3099)
* Remove redundant check for tag similarity (Mentioned in Issue #3123)

New in v8.0.0b2 (changes since Beta 1)
======================================


Important compatibility changes not mentioned previously
--------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions stories/conf.rst
@@ -1,11 +1,11 @@
.. title: Nikola v8.0.0b2 configuration file
.. title: Nikola v8.0.0b3 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 v8.0.0b2 is reproduced below.
The default config file for Nikola v8.0.0b3 is reproduced below.

.. raw:: html

Expand Down
2 changes: 1 addition & 1 deletion stories/extending.rst
Expand Up @@ -9,7 +9,7 @@
Extending Nikola
================

:Version: 8.0.0b2
:Version: 8.0.0b3
:Author: Roberto Alsina <ralsina@netmanagers.com.ar>

.. class:: alert alert-primary float-md-right
Expand Down
3 changes: 2 additions & 1 deletion stories/getting-started.html
Expand Up @@ -29,7 +29,8 @@ <h2 class="col-md-12 p-0" id="install">Step 1. Install Nikola</h2>

<div id="installAny">
<h3><i class="fab fa-python"></i> Any OS/general instructions</h3>
<p>The best way to install Nikola is to use <code class="gs-code gs-command">pip</code> in a virtualenv. We recommend installing the <code class="gs-code">"Nikola[extras]"</code> distribution to access some extra features, but you can drop the <code class="gs-code">[extras]</code> specifier if you don’t want them. <strong>Follow instructions <span class="d-print-none d-none d-md-inline">on the right</span><span class="d-none">/</span><span class="d-inline d-md-none">below</span>.</strong></p>
<p>The best way to install Nikola is to use <code class="gs-code gs-command">pip</code> in a virtualenv. We recommend installing the <code class="gs-code">"Nikola[extras]"</code> distribution to access some extra features, but you can drop the <code class="gs-code">[extras]</code> specifier if you don’t want them. <strong>Follow instructions <span class="d-print-none d-none d-md-inline">on the right</span><span class="d-none">/</span><span class="d-inline d-md-none">below</span>.</strong></p>
<p class="small">Hint: don’t use Pipenv. It makes stuff harder than it should be and won’t be a pleasant experience.</p>
</div>
<div id="installWindows">
<h3><i class="fab fa-windows"></i> Windows support</h3>
Expand Down
53 changes: 41 additions & 12 deletions stories/manual.rst
Expand Up @@ -10,13 +10,7 @@
The Nikola Handbook
===================

:Version: 8.0.0b2

.. class:: alert alert-warning

This handbook is for Nikola v8.0.0b2. See also: `v7.8.15 handbook
<https://getnikola.com/handbook-v7.html>`_, `upgrading to v8
<https://getnikola.com/blog/upgrading-to-nikola-v8.html>`_.
:Version: 8.0.0b3

.. class:: alert alert-primary float-md-right

Expand Down Expand Up @@ -414,6 +408,14 @@ to your configuration:
'author': 'John Doe'
}
url_type
Change the URL_TYPE setting for the given page only. Useful for eg. error
pages which cannot use relative URLs.

.. code:: restructuredtext
.. url_type: full_path
Metadata formats
~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -1254,14 +1256,39 @@ chart

.. code:: text
{{% raw %}}{{% chart Bar title='Browser usage evolution (in %)' %}}
x_labels='["2002","2003","2004","2005","2006","2007","2008","2009","2010","2011","2012"]'%}}
{{% raw %}}{{% chart Bar title='Browser usage evolution (in %)'
x_labels='["2002","2003","2004","2005","2006","2007"]' %}}
'Firefox', [None, None, 0, 16.6, 25, 31]
'Chrome', [None, None, None, None, None, None]
'IE', [85.8, 84.6, 84.7, 74.5, 66, 58.6]
'Others', [14.2, 15.4, 15.3, 8.9, 9, 10.4]
{{% /chart %}}{{% /raw %}}

Additionally, you can use a file_data argument which can point to a JSON or YAML file, and will be used for both arguments and data.
Example:

.. code:: json
{
"x_labels": ["2002","2003","2004","2005","2006","2007"],
"data": {
"Firefox": [null, null, 0, 16.6, 25, 31],
"Chrome": [null, null, null, null, null, null],
"IE": [85.8, 84.6, 84.7, 74.5, 66, 58.6],
"Others": [14.2, 15.4, 15.3, 8.9, 9, 10.4]
}
}
Which can be used like this:

.. code:: text
{{% raw %}}{{% chart Bar title='Browser usage evolution (in %)' data_file="posts/browsers.json" %}}
{{% /chart %}}
{{% /raw %}}
If the data or any option is available in both the ``data_file`` and the document, the document has priority.

doc
Will link to a document in the page, see `Doc role for details
<#doc>`__. Example:
Expand Down Expand Up @@ -1584,7 +1611,7 @@ Fancy Dates
Nikola can use various styles for presenting dates.

DATE_FORMAT
The date format to use if there is no JS or fancy dates are off. Compatible with Python’s ``strftime()`` syntax.
The date format to use if there is no JS or fancy dates are off. `Compatible with CLDR syntax. <http://cldr.unicode.org/translation/date-time>`_

JS_DATE_FORMAT
The date format to use if fancy dates are on. Compatible with ``moment.js`` syntax.
Expand Down Expand Up @@ -2653,14 +2680,16 @@ Here's an example of how it works:
The argument passed next to the directive (Bar in that example) is the type of chart, and can be one of
Line, StackedLine, Bar, StackedBar, HorizontalBar, XY, DateY, Pie, Radar, Dot, Funnel, Gauge, Pyramid. For
examples of what each kind of graph is, `check here <http://pygal.org/chart_types/>`_
examples of what each kind of graph is, `check here <http://pygal.org/en/stable/documentation/types/index.html>`_

It can take *a lot* of options to let you customize the charts (in the example, title and x_labels).
You can use any option described in `the pygal docs <http://pygal.org/basic_customizations/>`_
You can use any option described in `the pygal docs <http://pygal.org/en/stable/documentation/configuration/chart.html>`_

Finally, the content of the directive is the actual data, in the form of a label and
a list of values, one series per line.

You can also specify a ``:data_file:`` option as described in the documentation for the chart shortcut.

Doc
~~~

Expand Down
2 changes: 1 addition & 1 deletion stories/social_buttons.rst
Expand Up @@ -9,7 +9,7 @@
Using Alternative Social Buttons with Nikola
============================================

:Version: 8.0.0b2
:Version: 8.0.0b3

.. class:: alert alert-primary float-md-right

Expand Down
2 changes: 1 addition & 1 deletion stories/support.rst
Expand Up @@ -4,7 +4,7 @@
.. description: Get help using Nikola, or contact us.
.. author: The Nikola Team
:Version: 8.0.0b2
:Version: 8.0.0b3

.. class:: alert alert-primary float-md-right

Expand Down
2 changes: 1 addition & 1 deletion stories/template-variables.rst
Expand Up @@ -3,7 +3,7 @@
.. date: 2017-04-13 12:00:00
.. author: The Nikola Team
:Version: 8.0.0b2
:Version: 8.0.0b3
:Author: Chris Warrick <chris@getnikola.com>

Variables available in templates are listed below.
Expand Down

0 comments on commit 4dbcf5b

Please sign in to comment.