Skip to content

Commit

Permalink
merged master
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed May 5, 2015
2 parents cc78e50 + 6863ace commit 74c424a
Show file tree
Hide file tree
Showing 24 changed files with 503 additions and 89 deletions.
15 changes: 15 additions & 0 deletions CHANGES.txt
Expand Up @@ -5,6 +5,19 @@ Features
--------

* Smarter CDN support (Issue #1676)
* Substitutions for RSS_LINKS_APPEND_QUERY for identifying
the source feed (feedRelUri) and the kind of feed (feedFormat).
* New option GENERATE_ATOM, off by default
* Current and archive Atom feeds for indexes; category, tag, and archive indexes (RFC-4287 and RFC-5005)
* Atom feed auto-discovery in HTML indexes and category/tag indexes
* .atom included in the sitemap index
* New post metadata "updated", inherits "date" if unset
* Allow IPv6 in `nikola auto` (Issue #1682)
* Allow IPv6 in `nikola serve` (Issue #1682)
* Set default new site URL to https://example.com/
* Plugins can manipulate task dependencies (Issue #1679)
* LINK_CHECK_WHITELIST now works with output relative and full fs paths
>>>>>>> master
* Four new filters: html_tidy_nowrap, html_tidy_wrap, html_tidy_wrap_attr,
and html_tidy_mini for prettification and minification. Requires tidy5.
* Multilingual sitemaps (Issue #1610)
Expand All @@ -22,6 +35,8 @@ Features
Bugfixes
--------

* RSS_LINKS_APPEND_QUERY not working in RSS feeds for tags
* `nikola check -l` didn’t scan posts
* Don’t use sets for ``FAVICONS`` (Issue #1674)
* Posts/Pages that use post-list will never be up to date (Issue #1671)
* Support using post.text() in post_list_directive.tmpl (Issue #1671)
Expand Down
4 changes: 2 additions & 2 deletions docs/manual.txt
Expand Up @@ -1229,7 +1229,7 @@ You can disable comments for a post by adding a "nocomments" metadata field to i
#639).

An alternative or complement to comments are annotations. Nikola integrates
the annotation service provided by `AnnotateIt. <annotateit.org>`_
the annotation service provided by `AnnotateIt. <http://annotateit.org/>`_
To use it, set the ``ANNOTATIONS`` option to True. This is specially useful
if you want feedback on specific parts of your writing.

Expand Down Expand Up @@ -1273,7 +1273,7 @@ The ``conf.py`` options affecting images and gallery pages are these::
# destination folder. A thumbnail will also be created in the same folder with
# ``.thumbnail`` inserted in the file name before the file extension
# (e.g. ``tesla.thumbnail.jpg``).
IMAGE_FOLDERS = {'images': ''}
IMAGE_FOLDERS = {'images': 'images'}
# More image/gallery options:
THUMBNAIL_SIZE = 180
IMAGE_THUMBNAIL_SIZE = 400
Expand Down
2 changes: 1 addition & 1 deletion dodo.py
Expand Up @@ -38,7 +38,7 @@ def set_nikola_test_locales():
lang = line.split('_')[0]
if lang not in languages:
try:
locale.setlocale(locale.LC_ALL, line)
locale.setlocale(locale.LC_ALL, str(line))
except:
continue
languages.add(lang)
Expand Down
25 changes: 19 additions & 6 deletions nikola/conf.py.in
Expand Up @@ -388,7 +388,7 @@ REDIRECTIONS = ${REDIRECTIONS}
# side optimization for very high traffic sites or low memory servers.
# GZIP_FILES = False
# File extensions that will be compressed
# GZIP_EXTENSIONS = ('.txt', '.htm', '.html', '.css', '.js', '.json', '.xml')
# GZIP_EXTENSIONS = ('.txt', '.htm', '.html', '.css', '.js', '.json', '.atom', '.xml')
# Use an external gzip command? None means no.
# Example: GZIP_COMMAND = "pigz -k {filename}"
# GZIP_COMMAND = None
Expand Down Expand Up @@ -556,10 +556,14 @@ INDEX_READ_MORE_LINK = ${INDEX_READ_MORE_LINK}
# 'Read more...' for the RSS_FEED, if RSS_TEASERS is True (translatable)
RSS_READ_MORE_LINK = ${RSS_READ_MORE_LINK}

# Append a URL query to the RSS_READ_MORE_LINK and the //rss/item/link in
# RSS feeds. Minimum example for Piwik "pk_campaign=rss" and Google Analytics
# "utm_source=rss&utm_medium=rss&utm_campaign=rss". Advanced option used for
# traffic source tracking.
# Append a URL query to the RSS_READ_MORE_LINK in Atom and RSS feeds. Advanced
# option used for traffic source tracking.
# Minimum example for use with Piwik: "pk_campaign=feed"
# The following tags exist and are replaced for you:
# {feedRelUri} A relative link to the feed.
# {feedFormat} The name of the syndication format.
# Example using replacement for use with Google Analytics:
# "utm_source={feedRelUri}&utm_medium=nikola_feed&utm_campaign={feedFormat}_feed"
RSS_LINKS_APPEND_QUERY = False

# A HTML fragment describing the license, for the sidebar.
Expand Down Expand Up @@ -753,12 +757,21 @@ COMMENT_SYSTEM_ID = ${COMMENT_SYSTEM_ID}
# links to it. Set this to False to disable everything RSS-related.
# GENERATE_RSS = True

# By default, Nikola does not generates Atom files for indexes and links to
# them. Generate Atom for tags by setting TAG_PAGES_ARE_INDEXES to True.
# Atom feeds are built based on INDEX_DISPLAY_POST_COUNT and not FEED_LENGTH
# Switch between plain-text summaries and full HTML content using the
# RSS_TEASER option. RSS_LINKS_APPEND_QUERY is also respected. Atom feeds
# are generated even for old indexes and have pagination link relations
# between each other. Old Atom feeds with no changes are marked as archived.
# GENERATE_ATOM = False

# RSS_LINK is a HTML fragment to link the RSS or Atom feeds. If set to None,
# the base.tmpl will use the feed Nikola generates. However, you may want to
# change it for a FeedBurner feed or something else.
# RSS_LINK = None

# Show only teasers in the RSS feed? Default to True
# Show only teasers in the RSS and Atom feeds? Default to True
# RSS_TEASERS = True

# Strip HTML in the RSS feed? Default to False
Expand Down
28 changes: 28 additions & 0 deletions nikola/data/themes/base/assets/xml/atom.xsl
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width"/>
<title><xsl:value-of select="feed/title"/> (Atom feed)</title>
<style><![CDATA[html{margin:0;padding:0;}body{color:hsl(180,1%,31%);font-family:Helvetica,Arial,sans-serif;font-size:17px;line-height:1.4;margin:5%;max-width:35rem;padding:0;}input{min-width:20rem;margin-left:.2rem;padding-left:.2rem;padding-right:.2rem;}ol{list-style-type:disc;padding-left:1rem;}h2{font-size:22px;font-weight:inherit;}]]></style>
</head>
<body>
<h1><xsl:value-of select="feed/title"/> (Atom feed)</h1>
<p>This is an Atom feed. To subscribe to it, copy its address and paste it when your feed reader asks for it. It will be updated periodically in your reader. New to feeds? <a href="https://duckduckgo.com/?q=how+to+get+started+with+rss+feeds" title="Search on the web to learn more">Learn more</a>.</p>
<p>
<label for="address">Atom feed address:</label>
<input><xsl:attribute name="id">address</xsl:attribute><xsl:attribute name="spellcheck">false</xsl:attribute><xsl:attribute name="value"><xsl:value-of select="feed/link[@rel='self']/@href"/></xsl:attribute></input>
</p>
<p>Preview of the feed’s current headlines:</p>
<ol>
<xsl:for-each select="feed/entry">
<li><h2><a><xsl:attribute name="href"><xsl:value-of select="link[@rel='alternate']/@href"/></xsl:attribute><xsl:value-of select="title"/></a></h2></li>
</xsl:for-each>
</ol>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
6 changes: 3 additions & 3 deletions nikola/data/themes/base/assets/xml/rss.xsl
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width"/>
<title><xsl:value-of select="rss/channel/title"/> (RSS)</title>
<style><![CDATA[html{margin:0;pdding:0;}body{color:hsl(180,1%,31%);font-family:Helvetica,Arial,sans-serif;font-size:17px;line-height:1.4;margin:5%;max-width:35rem;padding:0;}input{min-width:20rem;margin-left:.2rem;padding-left:.2rem;padding-right:.2rem;}ol{list-style-type:disc;padding-left:1rem;}h2{font-size:22px;font-weight:inherit;}]]></style>
<style><![CDATA[html{margin:0;padding:0;}body{color:hsl(180,1%,31%);font-family:Helvetica,Arial,sans-serif;font-size:17px;line-height:1.4;margin:5%;max-width:35rem;padding:0;}input{min-width:20rem;margin-left:.2rem;padding-left:.2rem;padding-right:.2rem;}ol{list-style-type:disc;padding-left:1rem;}h2{font-size:22px;font-weight:inherit;}]]></style>
</head>
<body>
<h1><xsl:value-of select="rss/channel/title"/> (RSS)</h1>
Expand All @@ -18,7 +18,7 @@
</p>
<p>Preview of the feed’s current headlines:</p>
<ol>
<xsl:for-each select="rss/channel/item">
<xsl:for-each select="rss/channel/item">
<li><h2><a><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute><xsl:value-of select="title"/></a></h2></li>
</xsl:for-each>
</ol>
Expand Down
11 changes: 11 additions & 0 deletions nikola/data/themes/base/templates/archiveindex.tmpl
@@ -1,2 +1,13 @@
## -*- coding: utf-8 -*-
<%inherit file="index.tmpl"/>

<%block name="extra_head">
${parent.extra_head()}
%if len(translations) > 1 and generate_atom:
%for language in translations:
<link rel="alternate" type="application/atom+xml" title="Atom for the ${archive_name} section (${language})" href="${_link("archive_atom", archive_name, language)}">
%endfor
%elif generate_atom:
<link rel="alternate" type="application/atom+xml" title="Atom for the ${archive_name} archive" href="${_link("archive_atom", archive_name)}">
%endif
</%block>
9 changes: 9 additions & 0 deletions nikola/data/themes/base/templates/base_helper.tmpl
Expand Up @@ -93,6 +93,15 @@ lang="${lang}">
<link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
%endif
%endif
%if generate_atom:
%if len(translations) > 1:
%for language in translations:
<link rel="alternate" type="application/atom+xml" title="Atom (${language})" href="${_link('index_atom', None, language)}">
%endfor
%else:
<link rel="alternate" type="application/atom+xml" title="Atom" href="${_link('index_atom', None)}">
%endif
%endif
</%def>

<%def name="html_translations()">
Expand Down
11 changes: 11 additions & 0 deletions nikola/data/themes/base/templates/tagindex.tmpl
@@ -1,2 +1,13 @@
## -*- coding: utf-8 -*-
<%inherit file="index.tmpl"/>

<%block name="extra_head">
${parent.extra_head()}
%if len(translations) > 1 and generate_atom:
%for language in translations:
<link rel="alternate" type="application/atom+xml" title="Atom for the ${tag} section (${language})" href="${_link(kind + "_atom", tag, language)}">
%endfor
%elif generate_atom:
<link rel="alternate" type="application/atom+xml" title="Atom for the ${tag} section" href="${_link("tag" + "_atom", tag)}">
%endif
</%block>
2 changes: 1 addition & 1 deletion nikola/filters.py
Expand Up @@ -168,7 +168,7 @@ def _html_tidy_runner(infile, options):
try:
status = runinplace(r"tidy5 " + options, infile)
except subprocess.CalledProcessError as err:
status = 0 if err.returncode is 1 else err.returncode
status = 0 if err.returncode == 1 else err.returncode
return status


Expand Down

0 comments on commit 74c424a

Please sign in to comment.