Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 74c424a

Browse files
committedMay 5, 2015
merged master
2 parents cc78e50 + 6863ace commit 74c424a

24 files changed

+503
-89
lines changed
 

‎CHANGES.txt

+15
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ Features
55
--------
66

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

38+
* RSS_LINKS_APPEND_QUERY not working in RSS feeds for tags
39+
* `nikola check -l` didn’t scan posts
2540
* Don’t use sets for ``FAVICONS`` (Issue #1674)
2641
* Posts/Pages that use post-list will never be up to date (Issue #1671)
2742
* Support using post.text() in post_list_directive.tmpl (Issue #1671)

‎docs/manual.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ You can disable comments for a post by adding a "nocomments" metadata field to i
12291229
#639).
12301230

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

@@ -1273,7 +1273,7 @@ The ``conf.py`` options affecting images and gallery pages are these::
12731273
# destination folder. A thumbnail will also be created in the same folder with
12741274
# ``.thumbnail`` inserted in the file name before the file extension
12751275
# (e.g. ``tesla.thumbnail.jpg``).
1276-
IMAGE_FOLDERS = {'images': ''}
1276+
IMAGE_FOLDERS = {'images': 'images'}
12771277
# More image/gallery options:
12781278
THUMBNAIL_SIZE = 180
12791279
IMAGE_THUMBNAIL_SIZE = 400

‎dodo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def set_nikola_test_locales():
3838
lang = line.split('_')[0]
3939
if lang not in languages:
4040
try:
41-
locale.setlocale(locale.LC_ALL, line)
41+
locale.setlocale(locale.LC_ALL, str(line))
4242
except:
4343
continue
4444
languages.add(lang)

‎nikola/conf.py.in

+19-6
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ REDIRECTIONS = ${REDIRECTIONS}
388388
# side optimization for very high traffic sites or low memory servers.
389389
# GZIP_FILES = False
390390
# File extensions that will be compressed
391-
# GZIP_EXTENSIONS = ('.txt', '.htm', '.html', '.css', '.js', '.json', '.xml')
391+
# GZIP_EXTENSIONS = ('.txt', '.htm', '.html', '.css', '.js', '.json', '.atom', '.xml')
392392
# Use an external gzip command? None means no.
393393
# Example: GZIP_COMMAND = "pigz -k {filename}"
394394
# GZIP_COMMAND = None
@@ -556,10 +556,14 @@ INDEX_READ_MORE_LINK = ${INDEX_READ_MORE_LINK}
556556
# 'Read more...' for the RSS_FEED, if RSS_TEASERS is True (translatable)
557557
RSS_READ_MORE_LINK = ${RSS_READ_MORE_LINK}
558558

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

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

760+
# By default, Nikola does not generates Atom files for indexes and links to
761+
# them. Generate Atom for tags by setting TAG_PAGES_ARE_INDEXES to True.
762+
# Atom feeds are built based on INDEX_DISPLAY_POST_COUNT and not FEED_LENGTH
763+
# Switch between plain-text summaries and full HTML content using the
764+
# RSS_TEASER option. RSS_LINKS_APPEND_QUERY is also respected. Atom feeds
765+
# are generated even for old indexes and have pagination link relations
766+
# between each other. Old Atom feeds with no changes are marked as archived.
767+
# GENERATE_ATOM = False
768+
756769
# RSS_LINK is a HTML fragment to link the RSS or Atom feeds. If set to None,
757770
# the base.tmpl will use the feed Nikola generates. However, you may want to
758771
# change it for a FeedBurner feed or something else.
759772
# RSS_LINK = None
760773

761-
# Show only teasers in the RSS feed? Default to True
774+
# Show only teasers in the RSS and Atom feeds? Default to True
762775
# RSS_TEASERS = True
763776

764777
# Strip HTML in the RSS feed? Default to False
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0">
3+
<xsl:output method="xml"/>
4+
<xsl:template match="/">
5+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
6+
<head>
7+
<meta charset="UTF-8"/>
8+
<meta name="viewport" content="width=device-width"/>
9+
<title><xsl:value-of select="feed/title"/> (Atom feed)</title>
10+
<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>
11+
</head>
12+
<body>
13+
<h1><xsl:value-of select="feed/title"/> (Atom feed)</h1>
14+
<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>
15+
<p>
16+
<label for="address">Atom feed address:</label>
17+
<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>
18+
</p>
19+
<p>Preview of the feed’s current headlines:</p>
20+
<ol>
21+
<xsl:for-each select="feed/entry">
22+
<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>
23+
</xsl:for-each>
24+
</ol>
25+
</body>
26+
</html>
27+
</xsl:template>
28+
</xsl:stylesheet>

‎nikola/data/themes/base/assets/xml/rss.xsl

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<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">
2+
<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">
33
<xsl:output method="xml"/>
44
<xsl:template match="/">
55
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
66
<head>
77
<meta charset="UTF-8"/>
88
<meta name="viewport" content="width=device-width"/>
99
<title><xsl:value-of select="rss/channel/title"/> (RSS)</title>
10-
<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>
10+
<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>
1111
</head>
1212
<body>
1313
<h1><xsl:value-of select="rss/channel/title"/> (RSS)</h1>
@@ -18,7 +18,7 @@
1818
</p>
1919
<p>Preview of the feed’s current headlines:</p>
2020
<ol>
21-
<xsl:for-each select="rss/channel/item">
21+
<xsl:for-each select="rss/channel/item">
2222
<li><h2><a><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute><xsl:value-of select="title"/></a></h2></li>
2323
</xsl:for-each>
2424
</ol>
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
## -*- coding: utf-8 -*-
22
<%inherit file="index.tmpl"/>
3+
4+
<%block name="extra_head">
5+
${parent.extra_head()}
6+
%if len(translations) > 1 and generate_atom:
7+
%for language in translations:
8+
<link rel="alternate" type="application/atom+xml" title="Atom for the ${archive_name} section (${language})" href="${_link("archive_atom", archive_name, language)}">
9+
%endfor
10+
%elif generate_atom:
11+
<link rel="alternate" type="application/atom+xml" title="Atom for the ${archive_name} archive" href="${_link("archive_atom", archive_name)}">
12+
%endif
13+
</%block>

‎nikola/data/themes/base/templates/base_helper.tmpl

+9
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ lang="${lang}">
9393
<link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
9494
%endif
9595
%endif
96+
%if generate_atom:
97+
%if len(translations) > 1:
98+
%for language in translations:
99+
<link rel="alternate" type="application/atom+xml" title="Atom (${language})" href="${_link('index_atom', None, language)}">
100+
%endfor
101+
%else:
102+
<link rel="alternate" type="application/atom+xml" title="Atom" href="${_link('index_atom', None)}">
103+
%endif
104+
%endif
96105
</%def>
97106

98107
<%def name="html_translations()">
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
## -*- coding: utf-8 -*-
22
<%inherit file="index.tmpl"/>
3+
4+
<%block name="extra_head">
5+
${parent.extra_head()}
6+
%if len(translations) > 1 and generate_atom:
7+
%for language in translations:
8+
<link rel="alternate" type="application/atom+xml" title="Atom for the ${tag} section (${language})" href="${_link(kind + "_atom", tag, language)}">
9+
%endfor
10+
%elif generate_atom:
11+
<link rel="alternate" type="application/atom+xml" title="Atom for the ${tag} section" href="${_link("tag" + "_atom", tag)}">
12+
%endif
13+
</%block>

‎nikola/filters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def _html_tidy_runner(infile, options):
168168
try:
169169
status = runinplace(r"tidy5 " + options, infile)
170170
except subprocess.CalledProcessError as err:
171-
status = 0 if err.returncode is 1 else err.returncode
171+
status = 0 if err.returncode == 1 else err.returncode
172172
return status
173173

174174

0 commit comments

Comments
 (0)
Please sign in to comment.