Skip to content

Commit 86ec1da

Browse files
committedJan 18, 2015
Merge branch 'master' into fix-root-links
[ci skip] Conflicts: CHANGES.txt
2 parents aa3f967 + 9ab9bbe commit 86ec1da

File tree

20 files changed

+51
-135
lines changed

20 files changed

+51
-135
lines changed
 

‎CHANGES.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
New in master
1+
New in v7.3.0
22
=============
33

44
Features
55
--------
66

77
* Added ``root`` path handler (via Issues #1008, #1573)
8+
* Added RSS feeds to gallery HEAD (part of Issue #786)
89

910
Bugfixes
1011
--------
1112

1213
* Links to languages point to site root and not the blog (Issue #1008)
1314
* Brand link is now language-specific (Issue #1573)
1415
* Fixed compatibility with IPython 3.x (Issue #1581)
16+
* Compilers mark tasks as out of date if compiler-specific options and plugins change (Issue #1523)
1517

1618
New in v7.3.0
1719
=============

‎docs/man/nikola.1

-97
This file was deleted.

‎docs/man/nikola.1.gz

894 Bytes
Binary file not shown.

‎nikola/data/themes/base-jinja/templates/gallery.tmpl

+5
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@
3434
{{ comments.comment_form(None, permalink, title) }}
3535
{% endif %}
3636
{% endblock %}
37+
38+
{% block extra_head %}
39+
{{ super() }}
40+
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
41+
{% endblock %}

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

+5
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@
3434
${comments.comment_form(None, permalink, title)}
3535
%endif
3636
</%block>
37+
38+
<%block name="extra_head">
39+
${parent.extra_head()}
40+
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
41+
</%block>

‎nikola/data/themes/bootstrap-jinja/templates/gallery.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
{% block extra_head %}
4242
{{ super() }}
43+
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
4344
<style type="text/css">
4445
.image-block {
4546
display: inline-block;

‎nikola/data/themes/bootstrap/templates/gallery.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ ${comments.comment_form(None, permalink, title)}
4040

4141
<%block name="extra_head">
4242
${parent.extra_head()}
43+
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
4344
<style type="text/css">
4445
.image-block {
4546
display: inline-block;

‎nikola/data/themes/bootstrap3-jinja/templates/gallery.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
{% block extra_head %}
4343
{{ super() }}
44+
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
4445
<style type="text/css">
4546
.image-block {
4647
display: inline-block;

‎nikola/data/themes/bootstrap3/templates/gallery.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ ${comments.comment_form(None, permalink, title)}
4141

4242
<%block name="extra_head">
4343
${parent.extra_head()}
44+
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
4445
<style type="text/css">
4546
.image-block {
4647
display: inline-block;

‎nikola/plugins/command/check.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ def _call_nikola_list(site, arguments):
4747
command.append('--conf=' + site.configuration_filename)
4848
command.extend(["list", "--all"])
4949
result = []
50-
for task in subprocess.Popen(command, shell=False, stdout=subprocess.PIPE).stdout.readlines():
50+
if os.name == 'nt':
51+
shell = True
52+
command = ' '.join(command)
53+
else:
54+
shell = False
55+
for task in subprocess.Popen(command, shell=shell, stdout=subprocess.PIPE).stdout.readlines():
5156
result.append(task.decode('utf-8'))
5257
return result
5358

‎nikola/plugins/compile/markdown/__init__.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,18 @@ class CompileMarkdown(PageCompiler):
5353
site = None
5454

5555
def set_site(self, site):
56+
self.enabled_extensions = []
5657
for plugin_info in site.plugin_manager.getPluginsOfCategory("MarkdownExtension"):
5758
if plugin_info.name in site.config['DISABLED_PLUGINS']:
5859
site.plugin_manager.removePluginFromCategory(plugin_info, "MarkdownExtension")
5960
continue
60-
61+
self.enabled_extensions.append(plugin_info.name)
6162
site.plugin_manager.activatePluginByName(plugin_info.name)
6263
plugin_info.plugin_object.set_site(site)
6364
self.extensions.append(plugin_info.plugin_object)
6465
plugin_info.plugin_object.short_help = plugin_info.description
6566

67+
self.enabled_extensions += site.config.get("MARKDOWN_EXTENSIONS")
6668
return super(CompileMarkdown, self).set_site(site)
6769

6870
def compile_html(self, source, dest, is_two_file=True):
@@ -96,3 +98,7 @@ def create_post(self, path, **kw):
9698
fd.write(write_metadata(metadata))
9799
fd.write('-->\n\n')
98100
fd.write(content)
101+
102+
def register_extra_dependencies(self, post):
103+
"""Adds dependency to post object to check .dep file."""
104+
post.add_dependency_uptodate(self.enabled_extensions)

‎nikola/plugins/compile/pandoc.py

+4
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,7 @@ def create_post(self, path, **kw):
7070
fd.write(write_metadata(metadata))
7171
fd.write('-->\n\n')
7272
fd.write(content)
73+
74+
def register_extra_dependencies(self, post):
75+
"""Adds dependency to post object to check .dep file."""
76+
post.add_dependency_uptodate(self.site.config['PANDOC_OPTIONS'])

‎nikola/plugins/compile/rest/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def _read_extra_deps(self, post):
6363
def register_extra_dependencies(self, post):
6464
"""Adds dependency to post object to check .dep file."""
6565
post.add_dependency(lambda: self._read_extra_deps(post), 'fragment')
66+
post.add_dependency_uptodate(self.enabled_plugins)
6667

6768
def compile_html(self, source, dest, is_two_file=True):
6869
"""Compile reSt into HTML."""
@@ -128,12 +129,14 @@ def create_post(self, path, **kw):
128129
fd.write(content)
129130

130131
def set_site(self, site):
132+
self.enabled_plugins = []
131133
for plugin_info in site.plugin_manager.getPluginsOfCategory("RestExtension"):
132134
if plugin_info.name in site.config['DISABLED_PLUGINS']:
133135
site.plugin_manager.removePluginFromCategory(plugin_info, "RestExtension")
134136
continue
135137

136138
site.plugin_manager.activatePluginByName(plugin_info.name)
139+
self.enabled_plugins.append(plugin_info.name)
137140
plugin_info.plugin_object.set_site(site)
138141
plugin_info.plugin_object.short_help = plugin_info.description
139142

‎nikola/plugins/task/galleries.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ def gen_tasks(self):
234234
folder += '/'
235235
folders.append((folder, ft))
236236

237-
context["folders"] = natsort.natsorted(folders)
237+
context["folders"] = natsort.natsorted(
238+
folders, alg=natsort.ns.F | natsort.ns.IC)
238239
context["crumbs"] = crumbs
239240
context["permalink"] = self.site.link("gallery", gallery, lang)
240241
context["enable_comments"] = self.kw['comments_in_galleries']

‎nikola/plugins/task/listings.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@ def render_listing(in_name, out_name, input_folder, output_folder, folders=[], f
143143
'crumbs': crumbs,
144144
'permalink': permalink,
145145
'lang': self.kw['default_lang'],
146-
'folders': natsort.natsorted(folders),
147-
'files': natsort.natsorted(files),
146+
'folders': natsort.natsorted(
147+
folders, alg=natsort.ns.F | natsort.ns.IC),
148+
'files': natsort.natsorted(
149+
files, alg=natsort.ns.F | natsort.ns.IC),
148150
'description': title,
149151
'source_link': source_link,
150152
}

‎nikola/post.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ def __init__(
187187
self._tags = {}
188188
for lang in self.translated_to:
189189
self._tags[lang] = natsort.natsorted(
190-
list(set([x.strip() for x in self.meta[lang]['tags'].split(',')])))
190+
list(set([x.strip() for x in self.meta[lang]['tags'].split(',')])),
191+
alg=natsort.ns.F | natsort.ns.IC)
191192
self._tags[lang] = [t for t in self._tags[lang] if t]
192193
if 'draft' in self._tags[lang]:
193194
is_draft = True

‎requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ PyRSS2Gen>=1.1
1111
logbook>=0.7.0
1212
blinker>=1.3
1313
setuptools>=5.4.1
14-
natsort>=3.3.0
14+
natsort>=3.5.2

‎scripts/set_version.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import re
1010
import sys
1111
import glob
12+
import subprocess
1213

1314

1415
def sed_like_thing(pattern, repl, path):
@@ -34,4 +35,5 @@ def sed_like_thing(pattern, repl, path):
3435
sed_like_thing("release = .*", "release = '{0}'".format(version), os.path.join('docs', 'sphinx', 'conf.py'))
3536
sed_like_thing('__version__ = ".*"', '__version__ = "{0}"'.format(version), os.path.join('nikola', '__init__.py'))
3637
sed_like_thing('New in master', 'New in v{0}'.format(version), 'CHANGES.txt')
37-
os.system("help2man -h help -N --version-string='{0}' nikola > {1}".format(version, os.path.join('docs', 'man', 'nikola.1')))
38+
subprocess.call(["help2man", "-N", "--version-string={0}".format(version), "-n", "static site and blog generator", "-o", os.path.join('docs', 'man', 'nikola.1'), "nikola"])
39+
subprocess.call(["gzip", "-f", os.path.join('docs', 'man', 'nikola.1')])

‎setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[wheel]
2-
universal = 0
2+
universal = 1
33

44
[flake8]
55
ignore=E501

‎setup.py

+1-28
Original file line numberDiff line numberDiff line change
@@ -96,33 +96,6 @@ def expands_symlinks_for_windows():
9696
"\n\tYour best bet is to start again from clean.")
9797

9898

99-
def install_manpages(root, prefix):
100-
try:
101-
man_pages = [
102-
('docs/man/nikola.1', 'share/man/man1/nikola.1'),
103-
]
104-
join = os.path.join
105-
normpath = os.path.normpath
106-
if root is not None:
107-
prefix = os.path.realpath(root) + os.path.sep + prefix
108-
for src, dst in man_pages:
109-
path_dst = join(normpath(prefix), normpath(dst))
110-
try:
111-
os.makedirs(os.path.dirname(path_dst))
112-
except OSError:
113-
pass
114-
rst2man_cmd = ['rst2man.py', 'rst2man']
115-
for rst2man in rst2man_cmd:
116-
try:
117-
subprocess.call([rst2man, src, path_dst])
118-
except OSError:
119-
continue
120-
else:
121-
break
122-
except Exception as e:
123-
print("Not installing the man pages:", e)
124-
125-
12699
def remove_old_files(self):
127100
tree = os.path.join(self.install_lib, 'nikola')
128101
try:
@@ -136,7 +109,6 @@ def run(self):
136109
expands_symlinks_for_windows()
137110
remove_old_files(self)
138111
install.run(self)
139-
install_manpages(self.root, self.prefix)
140112

141113

142114
setup(name='Nikola',
@@ -187,6 +159,7 @@ def run(self):
187159
'docs/manual.txt',
188160
'docs/theming.txt',
189161
'docs/extending.txt']),
162+
('share/man/man1', ['docs/man/nikola.1.gz']),
190163
],
191164
entry_points = {
192165
'console_scripts': [

0 commit comments

Comments
 (0)
Please sign in to comment.