Skip to content
Permalink
Browse files
merged master
  • Loading branch information
ralsina committed Jan 27, 2016
2 parents 52e6c61 + f915421 commit 304b9e51a7b6c2d77b9541150a5b2d5e01dcd1b4
Showing with 120 additions and 52 deletions.
  1. +8 −1 CHANGES.txt
  2. +10 −4 docs/manual.txt
  3. +1 −0 nikola/data/shortcodes/jinja/raw.tmpl
  4. +1 −1 nikola/data/themes/base-jinja/templates/author.tmpl
  5. +4 −0 nikola/data/themes/base-jinja/templates/index_helper.tmpl
  6. +1 −1 nikola/data/themes/base-jinja/templates/list_post.tmpl
  7. +4 −0 nikola/data/themes/base-jinja/templates/post_helper.tmpl
  8. +1 −1 nikola/data/themes/base-jinja/templates/tag.tmpl
  9. +1 −1 nikola/data/themes/base/assets/css/theme.css
  10. +1 −1 nikola/data/themes/base/templates/author.tmpl
  11. +4 −0 nikola/data/themes/base/templates/index_helper.tmpl
  12. +1 −1 nikola/data/themes/base/templates/list_post.tmpl
  13. +4 −0 nikola/data/themes/base/templates/post_helper.tmpl
  14. +1 −1 nikola/data/themes/base/templates/tag.tmpl
  15. +1 −0 nikola/data/themes/bootstrap3-jinja/assets/css/bootstrap-theme.min.css.map
  16. +1 −0 nikola/data/themes/bootstrap3-jinja/assets/css/bootstrap.min.css.map
  17. +1 −1 nikola/data/themes/bootstrap3-jinja/assets/css/theme.css
  18. +2 −2 nikola/data/themes/bootstrap3-jinja/assets/js/flowr.plugin.js
  19. +1 −1 nikola/data/themes/bootstrap3/assets/css/theme.css
  20. +2 −2 nikola/data/themes/bootstrap3/assets/js/flowr.plugin.js
  21. +16 −16 nikola/filters.py
  22. +1 −1 nikola/nikola.py
  23. +5 −3 nikola/plugins/basic_import.py
  24. +1 −1 nikola/plugins/command/github_deploy.py
  25. +1 −1 nikola/plugins/command/import_wordpress.py
  26. +21 −6 nikola/plugins/command/init.py
  27. +2 −0 nikola/plugins/compile/html.py
  28. +4 −1 nikola/plugins/compile/ipynb.py
  29. +5 −0 nikola/plugins/compile/pandoc.py
  30. +2 −0 nikola/plugins/compile/rest/__init__.py
  31. +10 −3 nikola/plugins/task/authors.py
  32. +2 −2 requirements-tests.txt
@@ -10,12 +10,19 @@ Features
if ``GITHUB_COMMIT_SOURCE`` is set to True (Issue #2186)
* Hugo-like shortcodes (Issue #1707)
* New Galician translation
* New PRESERVE_EXIF_DATA to copy EXIF when resizing images (Issue #2204)

Bugfixes
--------

* Preserve EXIF data when resizing images (Issue #2204)
* Don’t attempt to create redirects for URLs with query strings in
WordPress imports if the site is in a subdirectory (Issue #2224)
* Avoid some random file rebuilds (Issue #2220)
* Honor ``MATHJAX_CONFIG``
* Display tags and archives in a unified format, with the date on the
left, instead of a misplaced dash in tags (Issue #2212)
* Decide is_mathjax based on current language tags (Issue #2205)
* Don't duplicate images in flowr when resizing page (Issue #2202)

New in v7.7.4
=============
@@ -2146,7 +2146,13 @@ Nikola is released under the `MIT license <https://getnikola.com/license.html>`_
components shipped along with Nikola, or required by it are released under
other licenses.

If you are not familiar with free software licensing: In general, you should be able to
do pretty much anything you want, unless you modify Nikola. If you modify it, and share
it with someone else, that someone else should get all your modifications under the same
license you got it.

If you are not familiar with free software licensing, here is a brief
explanation (this is NOT legal advice): In general, you can do pretty much
anything you want — including modifying Nikola, using and redistributing the
original version or the your modified version. However, if you redistribute
Nikola to someone else, either a modified version or the original version, the
full copyright notice and license text must be included in your distribution.
Nikola is provided “as is”, and the Nikola contributors are not liable for any
damage caused by the software. Read the `full license text
<https://getnikola.com/license.html>`_ for details.
@@ -0,0 +1 @@
{{ data }}
@@ -35,7 +35,7 @@
{% if posts %}
<ul class="postlist">
{% for post in posts %}
<li><a href="{{ post.permalink() }}" class="listtitle">{{ post.title()|e }}</a><time class="listdate" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format)|e }}">{{ post.formatted_date(date_format)|e }}</time></li>
<li><time class="listdate" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format)|e }}">{{ post.formatted_date(date_format)|e }}</time> <a href="{{ post.permalink() }}" class="listtitle">{{ post.title()|e }}</a></li>
{% endfor %}
</ul>
{% endif %}
@@ -28,9 +28,13 @@
</script>
{% else %}
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
{% if mathjax_config %}
{{ mathjax_config }}
{% else %}
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
</script>
{% endif %}
{% endif %}
{% endif %}
{% endmacro %}
@@ -9,7 +9,7 @@
{% if posts %}
<ul class="postlist">
{% for post in posts %}
<li><a href="{{ post.permalink() }}" class="listtitle">{{ post.title()|e }}</a> <time class="listdate" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format)|e }}">{{ post.formatted_date(date_format)|e }}</time></li>
<li><time class="listdate" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format)|e }}">{{ post.formatted_date(date_format)|e }}</time> <a href="{{ post.permalink() }}" class="listtitle">{{ post.title()|e }}</a></li>
{% endfor %}
</ul>
{% else %}
@@ -94,9 +94,13 @@
</script>
{% else %}
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
{% if mathjax_config %}
{{ mathjax_config }}
{% else %}
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
</script>
{% endif %}
{% endif %}
{% endif %}
{% endmacro %}
@@ -43,7 +43,7 @@
{% if posts %}
<ul class="postlist">
{% for post in posts %}
<li><time class="listdate" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format)|e }}">{{ post.formatted_date(date_format)|e }}</time><a href="{{ post.permalink() }}" class="listtitle">{{ post.title()|e }}<a></li>
<li><time class="listdate" datetime="{{ post.formatted_date('webiso') }}" title="{{ post.formatted_date(date_format)|e }}">{{ post.formatted_date(date_format)|e }}</time> <a href="{{ post.permalink() }}" class="listtitle">{{ post.title()|e }}<a></li>
{% endfor %}
</ul>
{% endif %}
@@ -120,7 +120,7 @@ body {
}
.metadata p:before,
.postpromonav .tags li:before,
.postlist .listdate:before {
.postlist .listdate:after {
content: " — ";
}
.postlist li {
@@ -35,7 +35,7 @@
%if posts:
<ul class="postlist">
% for post in posts:
<li><a href="${post.permalink()}" class="listtitle">${post.title()|h}</a><time class="listdate" datetime="${post.formatted_date('webiso')}" title="${post.formatted_date(date_format)|h}">${post.formatted_date(date_format)|h}</time></li>
<li><time class="listdate" datetime="${post.formatted_date('webiso')}" title="${post.formatted_date(date_format)|h}">${post.formatted_date(date_format)|h}</time> <a href="${post.permalink()}" class="listtitle">${post.title()|h}</a></li>
% endfor
</ul>
%endif
@@ -28,9 +28,13 @@
</script>
%else:
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
% if mathjax_config:
${mathjax_config}
% else:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
</script>
% endif
%endif
%endif
</%def>
@@ -9,7 +9,7 @@
%if posts:
<ul class="postlist">
% for post in posts:
<li><a href="${post.permalink()}" class="listtitle">${post.title()|h}</a> <time class="listdate" datetime="${post.formatted_date('webiso')}" title="${post.formatted_date(date_format)|h}">${post.formatted_date(date_format)|h}</time></li>
<li><time class="listdate" datetime="${post.formatted_date('webiso')}" title="${post.formatted_date(date_format)|h}">${post.formatted_date(date_format)|h}</time> <a href="${post.permalink()}" class="listtitle">${post.title()|h}</a></li>
% endfor
</ul>
%else:
@@ -94,9 +94,13 @@
</script>
%else:
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
% if mathjax_config:
${mathjax_config}
% else:
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
</script>
% endif
%endif
%endif
</%def>
@@ -43,7 +43,7 @@
%if posts:
<ul class="postlist">
% for post in posts:
<li><time class="listdate" datetime="${post.formatted_date('webiso')}" title="${post.formatted_date(date_format)|h}">${post.formatted_date(date_format)|h}</time><a href="${post.permalink()}" class="listtitle">${post.title()|h}<a></li>
<li><time class="listdate" datetime="${post.formatted_date('webiso')}" title="${post.formatted_date(date_format)|h}">${post.formatted_date(date_format)|h}</time> <a href="${post.permalink()}" class="listtitle">${post.title()|h}<a></li>
% endfor
</ul>
%endif

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

@@ -118,7 +118,7 @@ article.post-micro {
}

.metadata p:before,
.postlist .listdate:before {
.postlist .listdate:after {
content: " — ";
}

@@ -180,7 +180,7 @@
}
} //utils

// If the resposive var is set to true then listen for resize method
// If the responsive var is set to true then listen for resize method
// and prevent resizing from happening twice if responsive is set again during append phase!
if (settings.responsive && !$this.data('__responsive')) {
$(window).resize(function() {
@@ -211,7 +211,7 @@
var currentItem = 0;

// Store all the data
var allData = $this.data('data') || [];
var allData = [];
for (i = 0; i < data.length; i++) {
allData.push(data[i]);
}
@@ -118,7 +118,7 @@ article.post-micro {
}

.metadata p:before,
.postlist .listdate:before {
.postlist .listdate:after {
content: " — ";
}

@@ -180,7 +180,7 @@
}
} //utils

// If the resposive var is set to true then listen for resize method
// If the responsive var is set to true then listen for resize method
// and prevent resizing from happening twice if responsive is set again during append phase!
if (settings.responsive && !$this.data('__responsive')) {
$(window).resize(function() {
@@ -211,7 +211,7 @@
var currentItem = 0;

// Store all the data
var allData = $this.data('data') || [];
var allData = [];
for (i = 0; i < data.length; i++) {
allData.push(data[i]);
}
@@ -142,54 +142,54 @@ def yui_compressor(infile):
raise Exception("yui-compressor is not installed.")
return False

return runinplace(r'{} --nomunge %1 -o %2'.format(yuicompressor), infile)
return runinplace('{} --nomunge %1 -o %2'.format(yuicompressor), infile)


def closure_compiler(infile):
"""Run closure-compiler on a file."""
return runinplace(r'closure-compiler --warning_level QUIET --js %1 --js_output_file %2', infile)
return runinplace('closure-compiler --warning_level QUIET --js %1 --js_output_file %2', infile)


def optipng(infile):
"""Run optipng on a file."""
return runinplace(r"optipng -preserve -o2 -quiet %1", infile)
return runinplace("optipng -preserve -o2 -quiet %1", infile)


def jpegoptim(infile):
"""Run jpegoptim on a file."""
return runinplace(r"jpegoptim -p --strip-all -q %1", infile)
return runinplace("jpegoptim -p --strip-all -q %1", infile)


def html_tidy_withconfig(infile):
def html_tidy_withconfig(infile, executable='tidy5'):
"""Run HTML Tidy with tidy5.conf as config file."""
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 -indent -config tidy5.conf -modify %1")
return _html_tidy_runner(infile, "-quiet --show-info no --show-warnings no -utf8 -indent -config tidy5.conf -modify %1", executable=executable)


def html_tidy_nowrap(infile):
def html_tidy_nowrap(infile, executable='tidy5'):
"""Run HTML Tidy without line wrapping."""
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 -indent --indent-attributes no --sort-attributes alpha --wrap 0 --wrap-sections no --drop-empty-elements no --tidy-mark no -modify %1")
return _html_tidy_runner(infile, "-quiet --show-info no --show-warnings no -utf8 -indent --indent-attributes no --sort-attributes alpha --wrap 0 --wrap-sections no --drop-empty-elements no --tidy-mark no -modify %1", executable=executable)


def html_tidy_wrap(infile):
def html_tidy_wrap(infile, executable='tidy5'):
"""Run HTML Tidy with line wrapping."""
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 -indent --indent-attributes no --sort-attributes alpha --wrap 80 --wrap-sections no --drop-empty-elements no --tidy-mark no -modify %1")
return _html_tidy_runner(infile, "-quiet --show-info no --show-warnings no -utf8 -indent --indent-attributes no --sort-attributes alpha --wrap 80 --wrap-sections no --drop-empty-elements no --tidy-mark no -modify %1", executable=executable)


def html_tidy_wrap_attr(infile):
def html_tidy_wrap_attr(infile, executable='tidy5'):
"""Run HTML tidy with line wrapping and attribute indentation."""
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 -indent --indent-attributes yes --sort-attributes alpha --wrap 80 --wrap-sections no --drop-empty-elements no --tidy-mark no -modify %1")
return _html_tidy_runner(infile, "-quiet --show-info no --show-warnings no -utf8 -indent --indent-attributes yes --sort-attributes alpha --wrap 80 --wrap-sections no --drop-empty-elements no --tidy-mark no -modify %1", executable=executable)


def html_tidy_mini(infile):
def html_tidy_mini(infile, executable='tidy5'):
"""Run HTML tidy with minimal settings."""
return _html_tidy_runner(infile, r"-quiet --show-info no --show-warnings no -utf8 --indent-attributes no --sort-attributes alpha --wrap 0 --wrap-sections no --tidy-mark no --drop-empty-elements no -modify %1")
return _html_tidy_runner(infile, "-quiet --show-info no --show-warnings no -utf8 --indent-attributes no --sort-attributes alpha --wrap 0 --wrap-sections no --tidy-mark no --drop-empty-elements no -modify %1", executable=executable)


def _html_tidy_runner(infile, options):
def _html_tidy_runner(infile, options, executable='tidy5'):
"""Run HTML Tidy."""
# Warnings (returncode 1) are not critical, and *everything* is a warning.
try:
status = runinplace(r"tidy5 " + options, infile)
status = runinplace(executable + " " + options, infile)
except subprocess.CalledProcessError as err:
status = 0 if err.returncode == 1 else err.returncode
return status
@@ -2201,7 +2201,7 @@ def generic_index_renderer(self, lang, posts, indexes_title, template_name, cont

def __repr__(self):
"""Representation of a Nikola site."""
return '<Nikola Site: {0!r}>'.format(self.config['BLOG_TITLE']())
return '<Nikola Site: {0!r}>'.format(self.config['BLOG_TITLE'](self.config['DEFAULT_LANG']))


def sanitized_locales(locale_fallback, locale_default, locales, translations):
@@ -76,8 +76,11 @@ def get_channel_from_file(cls, filename):
return channel

@staticmethod
def configure_redirections(url_map):
def configure_redirections(url_map, base_dir=''):
"""Configure redirections from an url_map."""
index = base_dir + 'index.html'
if index.startswith('/'):
index = index[1:]
redirections = []
for k, v in url_map.items():
if not k[-1] == '/':
@@ -86,11 +89,10 @@ def configure_redirections(url_map):
# remove the initial "/" because src is a relative file path
src = (urlparse(k).path + 'index.html')[1:]
dst = (urlparse(v).path)
if src == 'index.html':
if src == index:
utils.LOGGER.warn("Can't do a redirect for: {0!r}".format(k))
else:
redirections.append((src, dst))

return redirections

def generate_base_site(self):
@@ -53,7 +53,7 @@ def check_ghp_import_installed():
except OSError:
# req_missing defaults to `python=True` — and it’s meant to be like this.
# `ghp-import` is installed via pip, but the only way to use it is by executing the script it installs.
req_missing(['ghp-import'], 'deploy the site to GitHub Pages')
req_missing(['ghp-import2'], 'deploy the site to GitHub Pages')


class CommandGitHubDeploy(Command):
@@ -334,7 +334,7 @@ def show_info_about_mising_module(modulename):
self.context['TRANSLATIONS'] = format_default_translations_config(
self.extra_languages)
self.context['REDIRECTIONS'] = self.configure_redirections(
self.url_map)
self.url_map, self.base_dir)
if self.timezone:
self.context['TIMEZONE'] = self.timezone
if self.export_categories_as_categories:

0 comments on commit 304b9e5

Please sign in to comment.