Skip to content
Permalink
Browse files

Merge branch 'master' into yaml-playground

  • Loading branch information
ralsina committed Jun 23, 2017
2 parents 84bce32 + f9f3c54 commit 7e812661be668700a1fc67da4f1cf347c9eca585
Showing with 463 additions and 272 deletions.
  1. +11 −1 CHANGES.txt
  2. +0 −1 docs/sphinx/requirements-docs.txt
  3. +9 −3 nikola/data/themes/base-jinja/templates/archiveindex.tmpl
  4. +2 −4 nikola/data/themes/base-jinja/templates/author.tmpl
  5. +14 −1 nikola/data/themes/base-jinja/templates/authorindex.tmpl
  6. +8 −0 nikola/data/themes/base-jinja/templates/authors.tmpl
  7. +2 −2 nikola/data/themes/base-jinja/templates/base_helper.tmpl
  8. +93 −60 nikola/data/themes/base-jinja/templates/feeds_translations_helper.tmpl
  9. +1 −1 nikola/data/themes/base-jinja/templates/index.tmpl
  10. +5 −1 nikola/data/themes/base-jinja/templates/list.tmpl
  11. +5 −1 nikola/data/themes/base-jinja/templates/list_post.tmpl
  12. +5 −2 nikola/data/themes/base-jinja/templates/sectionindex.tmpl
  13. +3 −5 nikola/data/themes/base-jinja/templates/tag.tmpl
  14. +5 −2 nikola/data/themes/base-jinja/templates/tagindex.tmpl
  15. +8 −0 nikola/data/themes/base-jinja/templates/tags.tmpl
  16. +9 −3 nikola/data/themes/base/templates/archiveindex.tmpl
  17. +2 −4 nikola/data/themes/base/templates/author.tmpl
  18. +14 −1 nikola/data/themes/base/templates/authorindex.tmpl
  19. +8 −0 nikola/data/themes/base/templates/authors.tmpl
  20. +2 −2 nikola/data/themes/base/templates/base_helper.tmpl
  21. +97 −64 nikola/data/themes/base/templates/feeds_translations_helper.tmpl
  22. +1 −1 nikola/data/themes/base/templates/index.tmpl
  23. +5 −1 nikola/data/themes/base/templates/list.tmpl
  24. +5 −1 nikola/data/themes/base/templates/list_post.tmpl
  25. +5 −2 nikola/data/themes/base/templates/sectionindex.tmpl
  26. +3 −5 nikola/data/themes/base/templates/tag.tmpl
  27. +5 −2 nikola/data/themes/base/templates/tagindex.tmpl
  28. +8 −0 nikola/data/themes/base/templates/tags.tmpl
  29. +8 −0 nikola/data/themes/bootstrap3-jinja/templates/authors.tmpl
  30. +2 −2 nikola/data/themes/bootstrap3-jinja/templates/base_helper.tmpl
  31. +8 −0 nikola/data/themes/bootstrap3-jinja/templates/tags.tmpl
  32. +8 −0 nikola/data/themes/bootstrap3/templates/authors.tmpl
  33. +2 −2 nikola/data/themes/bootstrap3/templates/base_helper.tmpl
  34. +8 −0 nikola/data/themes/bootstrap3/templates/tags.tmpl
  35. +0 −1 nikola/nikola.py
  36. +1 −8 nikola/plugin_categories.py
  37. +2 −2 nikola/plugins/command/auto/__init__.py
  38. +1 −1 nikola/plugins/command/bootswatch_theme.py
  39. +2 −2 nikola/plugins/command/check.py
  40. +2 −2 nikola/plugins/command/console.py
  41. +2 −2 nikola/plugins/command/deploy.py
  42. +12 −7 nikola/plugins/command/github_deploy.py
  43. +1 −1 nikola/plugins/command/import_wordpress.py
  44. +2 −2 nikola/plugins/command/init.py
  45. +8 −2 nikola/plugins/command/new_post.py
  46. +1 −1 nikola/plugins/command/plugin.py
  47. +2 −2 nikola/plugins/command/serve.py
  48. +1 −1 nikola/plugins/command/theme.py
  49. +8 −1 nikola/plugins/compile/html.py
  50. +2 −2 nikola/plugins/compile/ipynb.py
  51. +2 −2 nikola/plugins/compile/markdown/mdx_gist.py
  52. +1 −2 nikola/plugins/compile/rest/__init__.py
  53. +1 −1 nikola/plugins/misc/scan_posts.py
  54. +1 −1 nikola/plugins/misc/taxonomies_classifier.py
  55. +1 −1 nikola/plugins/shortcode/emoji/__init__.py
  56. +1 −2 nikola/plugins/task/archive.py
  57. +0 −5 nikola/plugins/task/authors.py
  58. +1 −1 nikola/plugins/task/bundles.py
  59. +0 −3 nikola/plugins/task/categories.py
  60. +1 −1 nikola/plugins/task/copy_assets.py
  61. +1 −1 nikola/plugins/task/galleries.py
  62. +0 −1 nikola/plugins/task/indexes.py
  63. +3 −1 nikola/plugins/task/page_index.py
  64. +1 −1 nikola/plugins/task/scale_images.py
  65. +0 −1 nikola/plugins/task/sections.py
  66. +0 −3 nikola/plugins/task/tags.py
  67. +15 −2 nikola/plugins/task/taxonomies.py
  68. +2 −2 nikola/plugins/template/mako.py
  69. +4 −8 nikola/utils.py
  70. +10 −7 scripts/jinjify.py
  71. +0 −15 tests/data/translated_titles/conf.py
@@ -5,20 +5,30 @@ Features
--------

* Use ``PRETTY_URLS`` by default on all sites (Issue #1838)
* Feed link generation is completely refactored (Issue #2844)

Bugfixes
--------

* Fix crash when compiling empty ``.html`` posts (Issue #2851)
* Make failures to get source commit hash non-fatal in
``github_deploy`` (Issue #2847)
* Less cryptic error when guessing format from extension in ``new_post``
fails
* Use Jupyter name more consistently in docs
* Support CODE_COLOR_SCHEME in Jupyter notebooks (Issue #2093)

* Language was not passed to title and link generation for page indexes

Removed features
----------------

* Drop Python 2 support
* Remove ``nikola install_theme`` — use ``nikola theme`` instead
* Drop insecure post encryption feature
* Stop supporting all deprecated config options
* Drop annotations support (annotateit.org closed down in March 2017)
* Remove taxonomy option ``also_create_classifications_from_other_languages``
(Issue #2785)

New in v7.8.8
=============
@@ -1,3 +1,2 @@
-r ../../requirements-extras.txt
doit
pyparsing>=2.0.2
@@ -5,10 +5,16 @@

{% block extra_head %}
{{ super() }}
{{ feeds_translations.head(archive_name) }}
{{ feeds_translations.head(archive_name, kind, rss_override=False) }}
{% endblock %}

{% block content_header %}
{{ archive_nav.archive_navigation() }}
{{ parent.content_header() }}
<header>
<h1>{{ title|e }}</h1>
{{ archive_nav.archive_navigation() }}
<div class="metadata">
{{ feeds_translations.feed_link(archive, kind) }}
{{ feeds_translations.translation_link(kind) }}
</div>
</header>
{% endblock %}
@@ -3,11 +3,9 @@
{% import 'feeds_translations_helper.tmpl' as feeds_translations with context %}

{% block extra_head %}
{{ super() }}
{{ feeds_translations.head(author) }}
{{ feeds_translations.head(author, kind, rss_override=False) }}
{% endblock %}


{% block content %}
<article class="authorpage">
<header>
@@ -16,7 +14,7 @@
<p>{{ description }}</p>
{% endif %}
<div class="metadata">
{{ feeds_translations.feed_link(author) }}
{{ feeds_translations.feed_link(author, kind) }}
</div>
</header>
{% if posts %}
@@ -2,7 +2,20 @@
{% extends 'index.tmpl' %}
{% import 'feeds_translations_helper.tmpl' as feeds_translations with context %}

{% block content_header %}
<header>
<h1>{{ title|e }}</h1>
{% if description %}
<p>{{ description }}</p>
{% endif %}
<div class="metadata">
{{ feeds_translations.feed_link(author, kind) }}
{{ feeds_translations.translation_link(kind) }}
</div>
</header>
{% endblock %}

{% block extra_head %}
{{ super() }}
{{ feeds_translations.head(author) }}
{{ feeds_translations.head(author, kind, rss_override=False) }}
{% endblock %}
@@ -1,10 +1,18 @@
{# -*- coding: utf-8 -*- #}
{% extends 'base.tmpl' %}
{% import 'feeds_translations_helper.tmpl' as feeds_translations with context %}

{% block extra_head %}
{{ feeds_translations.head(kind=kind, feeds=False) }}
{% endblock %}

{% block content %}
<article class="authorindex">
{% if items %}
<h2>{{ messages("Authors") }}</h2>
<div class="metadata">
{{ feeds_translations.translation_link(kind) }}
</div>
<ul class="postlist">
{% for text, link in items %}
{% if text not in hidden_authors %}
@@ -42,7 +42,7 @@ lang="{{ lang }}">
{% if meta_generator_tag %}
<meta name="generator" content="Nikola (getnikola.com)">
{% endif %}
{{ feeds_translations.head() }}
{{ feeds_translations.head(classification=None, kind='index', other=False) }}
<link rel="canonical" href="{{ abs_link(permalink) }}">

{% if favicons %}
@@ -101,7 +101,7 @@ lang="{{ lang }}">

{# This function is deprecated; use feed_helper directly. #}
{% macro html_feedlinks() %}
{{ feeds_translations.head() }}
{{ feeds_translations.head(classification=None, kind='index', other=False) }}
{% endmacro %}

{% macro html_translations() %}
@@ -1,90 +1,123 @@
{# -*- coding: utf-8 -*- #}

{# Handles both feeds and translations #}
{% macro head(classification=None) %}
{% if rss_link %}
{{ rss_link }}
{% macro _head_feed_link(link_type, link_name, link_postfix, classification, kind, language) %}
{% if translations|length > 1 %}
<link rel="alternate" type="{{ link_type }}" title="{{ link_name|e }} ({{ language }})" hreflang="{{ language }}" href="{{ _link(kind + '_' + link_postfix, classification, language) }}">
{% else %}
<link rel="alternate" type="{{ link_type }}" title="{{ link_name|e }}" hreflang="{{ language }}" href="{{ _link(kind + '_' + link_postfix, classification, language) }}">
{% endif %}
{% endmacro %}

{% macro _html_feed_link(link_type, link_name, link_postfix, classification, kind, language, name=None) %}
{% if translations|length > 1 %}
{% for language in translations|sort %}
{% if classification %}
{% if generate_atom %}
<link rel="alternate" type="application/atom+xml" title="Atom for {{ kind }} {{ classification|e }} ({{ language }})" href="{{ _link(kind + "_atom", classification, language) }}">
{% endif %}
{% if generate_rss and not rss_link %}
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ classification|e }} ({{ language }})" href="{{ _link(kind + "_rss", classification, language) }}">
{% endif %}
{% else %}
{% if generate_atom %}
<link rel="alternate" type="application/atom+xml" title="Atom ({{ language }})" href="{{ _link("index_atom", None, language) }}">
{% endif %}
{% if generate_rss and not rss_link %}
<link rel="alternate" type="application/rss+xml" title="RSS ({{ language }})" href="{{ _link("rss", None, language) }}">
{% endif %}
{% endif %}
{% endfor %}
{% if name and kind != "archive" and kind != "author" %}
<a href="{{ _link(kind + '_' + link_postfix, classification, language) }}" hreflang="{{ language }}" type="{{ link_type }}">{{ messages(link_name, language) }} ({{ name|e }}, {{ language }})</a>
{% else %}
<a href="{{ _link(kind + '_' + link_postfix, classification, language) }}" hreflang="{{ language }}" type="{{ link_type }}">{{ messages(link_name, language) }} ({{ language }})</a>
{% endif %}
{% else %}
{% if classification %}
{% if generate_atom %}
<link rel="alternate" type="application/atom+xml" title="Atom for {{ kind }} {{ classification|e }}" href="{{ _link(kind + "_atom", classification) }}">
{% endif %}
{% if generate_rss and not rss_link %}
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ classification|e }}" href="{{ _link(kind + "_rss", classification) }}">
{% endif %}
{% if name and kind != "archive" and kind != "author" %}
<a href="{{ _link(kind + '_' + link_postfix, classification, language) }}" hreflang="{{ language }}" type="{{ link_type }}">{{ messages(link_name, language) }} ({{ name|e }})</a>
{% else %}
{% if generate_atom %}
<link rel="alternate" type="application/atom+xml" title="Atom" href="{{ _link("index_atom", None) }}">
{% endif %}
{% if generate_rss and not rss_link %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ _link("rss", None) }}">
{% endif %}
<a href="{{ _link(kind + '_' + link_postfix, classification, language) }}" hreflang="{{ language }}" type="{{ link_type }}">{{ messages(link_name, language) }}</a>
{% endif %}
{% endif %}
{% if has_other_languages and other_languages %}
{% endmacro %}

{% macro _html_translation_link(classification, kind, language, name=None) %}
{% if name and kind != "archive" and kind != "author" %}
<a href="{{ _link(kind, classification, language) }}" hreflang="{{ language }}" rel="alternate">{{ messages("LANGUAGE", language) }} ({{ name|e }})</a>
{% else %}
<a href="{{ _link(kind, classification, language) }}" hreflang="{{ language }}" rel="alternate">{{ messages("LANGUAGE", language) }}</a>
{% endif %}
{% endmacro %}

{% macro _head_rss(classification=None, kind='index', rss_override=True) %}
{% if rss_link and rss_override %}
{{ rss_link }}
{% endif %}
{% if generate_rss and not (rss_link and rss_override) and kind != 'archive' %}
{% if translations|length > 1 and has_other_languages and classification and kind != 'index' %}
{% for language, classification, name in all_languages %}
<link rel="alternate" type="application/rss+xml" title="RSS for {{ kind }} {{ name|e }} ({{ language }})" hreflang="{{ language }}" href="{{ _link(kind + "_rss", classification, language) }}">
{% endfor %}
{% else %}
{% for language in translations|sort %}
{% if (classification or classification == '') and kind != 'index' %}
{{ _head_feed_link('application/rss+xml', 'RSS for ' + kind + ' ' + classification, 'rss', classification, kind, language) }}
{% else %}
{{ _head_feed_link('application/rss+xml', 'RSS', 'rss', classification, 'index', language) }}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endmacro %}

{% macro _head_atom(classification=None, kind='index') %}
{% if generate_atom %}
{% if translations|length > 1 and has_other_languages and classification and kind != 'index' %}
{% for language, classification, name in all_languages %}
<link rel="alternate" type="application/atom+xml" title="Atom for {{ kind }} {{ name|e }} ({{ language }})" hreflang="{{ language }}" href="{{ _link(kind + "_atom", classification, language) }}">
{% endfor %}
{% else %}
{% for language in translations|sort %}
{% if (classification or classification == '') and kind != 'index' %}
{{ _head_feed_link('application/atom+xml', 'Atom for ' + kind + ' ' + classification, 'atom', classification, kind, language) }}
{% else %}
{{ _head_feed_link('application/atom+xml', 'Atom', 'atom', classification, 'index', language) }}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endmacro %}

{# Handles both feeds and translations #}
{% macro head(classification=None, kind='index', feeds=True, other=True, rss_override=True, has_no_feeds=False) %}
{% if feeds and not has_no_feeds %}
{{ _head_rss(classification, 'index' if (kind == 'archive' and rss_override) else kind, rss_override) }}
{{ _head_atom(classification, kind) }}
{% endif %}
{% if other and has_other_languages and other_languages %}
{% for language, classification, _ in other_languages %}
<link rel="alternate" hreflang="{{ language }}" href="{{ _link(kind, classification, language) }}">
{% endfor %}
{% endif %}
{% endmacro %}

{% macro feed_link(classification) %}
{% if translations|length > 1 %}
{% for language in translations|sort %}
{% if generate_atom or generate_rss %}
{% macro feed_link(classification, kind) %}
{% if generate_atom or generate_rss %}
{% if translations|length > 1 and has_other_languages and kind != 'index' %}
{% for language, classification, name in all_languages %}
<p class="feedlink">
{% if generate_atom %}
<a href="{{ _link(kind + "_atom", classification, language) }}" hreflang="{{ language }}" type="application/atom+xml">{{ messages('Atom feed', language) }} ({{ language }})</a>
{{ _html_feed_link('application/atom+xml', 'Atom feed', 'atom', classification, kind, language, name) }}
{% endif %}
{% if generate_rss %}
<a href="{{ _link(kind + "_rss", classification, language) }}" hreflang="{{ language }}" type="application/rss+xml">{{ messages('RSS feed', language) }} ({{ language }})</a>
{% if generate_rss and kind != 'archive' %}
{{ _html_feed_link('application/rss+xml', 'RSS feed', 'rss', classification, kind, language, name) }}
{% endif %}
</p>
{% endif %}
{% endfor %}
{% else %}
{% if generate_atom or generate_rss %}
<p class="feedlink">
{% if generate_atom %}
<a href="{{ _link(kind + "_atom", classification) }}" type="application/atom+xml">{{ messages('Atom feed') }}</a>
{% endif %}
{% if generate_rss %}
<a href="{{ _link(kind + "_rss", classification) }}" type="application/rss+xml">{{ messages('RSS feed') }}</a>
{% endif %}
</p>
{% endfor %}
{% else %}
{% for language in translations|sort %}
<p class="feedlink">
{% if generate_atom %}
{{ _html_feed_link('application/atom+xml', 'Atom feed', 'atom', classification, kind, language) }}
{% endif %}
{% if generate_rss and kind != 'archive' %}
{{ _html_feed_link('application/rss+xml', 'RSS feed', 'rss', classification, kind, language) }}
{% endif %}
</p>
{% endfor %}
{% endif %}
{% endif %}
{% endmacro %}

{% macro translation_link() %}
{% macro translation_link(kind) %}
{% if has_other_languages and other_languages %}
<div class="translationslist translations">
<h3 class="translationslist-intro">{{ messages("Also available in:") }}</h3>
{% for language, classification, name in other_languages %}
<p><a href="{{ _link(kind, classification, language) }}" rel="alternate">{{ messages("LANGUAGE", language) }}
{% if kind != 'archive' %}
({{ name|e }})
{% endif %}
</a></p>
<p>{{ _html_translation_link(classification, kind, language, name) }}</p>
{% endfor %}
</div>
{% endif %}
@@ -16,7 +16,7 @@

{% block content %}
{% block content_header %}
{{ feeds_translations.translation_link() }}
{{ feeds_translations.translation_link(kind) }}
{% endblock %}
{% if 'main_index' in pagekind %}
{{ front_index_header }}
@@ -3,13 +3,17 @@
{% import 'archive_navigation_helper.tmpl' as archive_nav with context %}
{% import 'feeds_translations_helper.tmpl' as feeds_translations with context %}

{% block extra_head %}
{{ feeds_translations.head(kind=kind, rss_override=False, has_no_feeds=has_no_feeds) }}
{% endblock %}

{% block content %}
<article class="listpage">
<header>
<h1>{{ title|e }}</h1>
</header>
{{ archive_nav.archive_navigation() }}
{{ feeds_translations.translation_link() }}
{{ feeds_translations.translation_link(kind) }}
{% if items %}
<ul class="postlist">
{% for text, link, count in items %}
@@ -3,13 +3,17 @@
{% import 'archive_navigation_helper.tmpl' as archive_nav with context %}
{% import 'feeds_translations_helper.tmpl' as feeds_translations with context %}

{% block extra_head %}
{{ feeds_translations.head(kind=kind, rss_override=False) }}
{% endblock %}

{% block content %}
<article class="listpage">
<header>
<h1>{{ title|e }}</h1>
</header>
{{ archive_nav.archive_navigation() }}
{{ feeds_translations.translation_link() }}
{{ feeds_translations.translation_link(kind) }}
{% if posts %}
<ul class="postlist">
{% for post in posts %}
@@ -4,14 +4,17 @@

{% block extra_head %}
{{ super() }}
{{ feeds_translations.head(section) }}
{{ feeds_translations.head(section, kind, rss_override=False) }}
{% endblock %}

{% block content %}
<div class="sectionindex">
<header>
<h2><a href="{{ _link('section_index', section) }}">{{ title|e }}</a></h2>
{{ feeds_translations.feed_link(section) }}
<div class="metadata">
{{ feeds_translations.feed_link(section, kind) }}
{{ feeds_translations.translation_link(kind) }}
</div>
</header>
{{ super() }}
</div>

0 comments on commit 7e81266

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