我正在尝试用于测试网站的Nikola静态网站生成器,我遇到了这个问题。我正在提交代码和错误消息。
这是我的菜单代码(直接来自Nikola手册)
NAVIGATION_LINKS = {
DEFAULT_LANG: (
('/archive.html', 'Archives'),
('/categories/index.html', 'Tags'),
('/rss.xml', 'RSS'),
((('/foo', 'FOO'),
('/bar', 'BAR')), 'BAZ'),
),
}
这是产生的错误:
TaskError - taskid:render_tags:output/categories/index.html
PythonAction Error
Traceback (most recent call last):
File "/home/satish/.virtualenvs/nikola/local/lib/python2.7/site-packages/doit/action.py", line 360, in execute
returned_value = self.py_callable(*self.args, **kwargs)
File "/home/satish/.virtualenvs/nikola/local/lib/python2.7/site-packages/nikola/nikola.py", line 639, in render_template
template_name, None, local_context)
File "/home/satish/.virtualenvs/nikola/local/lib/python2.7/site-packages/nikola/plugins/template/jinja.py", line 74, in render_template
output = template.render(**context)
File "/home/satish/.virtualenvs/nikola/local/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "/home/satish/.virtualenvs/nikola/local/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "themes/bootstrap3-jinja/templates/tags.tmpl", line 2, in top-level template code
{% extends 'base.tmpl' %}
File "themes/bootstrap3-jinja/templates/base.tmpl", line 41, in top-level template code
{{ bootstrap.html_navigation_links() }}
File "themes/bootstrap3-jinja/templates/bootstrap_helper.tmpl", line 93, in template
{% if rel_link(permalink, url) == "#" %}
File "/home/satish/.virtualenvs/nikola/local/lib/python2.7/site-packages/nikola/nikola.py", line 901, in rel_link
dst = urljoin(src, dst)
File "/usr/lib/python2.7/urlparse.py", line 253, in urljoin
urlparse(url, bscheme, allow_fragments)
File "/usr/lib/python2.7/urlparse.py", line 135, in urlparse
tuple = urlsplit(url, scheme, allow_fragments)
File "/usr/lib/python2.7/urlparse.py", line 174, in urlsplit
i = url.find(':')
AttributeError: 'tuple' object has no attribute 'find'
我使用的是bootstrap3-jinja
主题。
我希望我已经找到了产生错误的代码的正确部分。
请(某人)添加nikola
作为标记。我没有必要的声誉来创建它。
从我测试的Nikola
开始,这是一个非常棒的博客工具。
感谢。
答案 0 :(得分:1)
这是尼古拉的一个错误。它已在GitHub主机上修复。请:
base-jinja
子目录中删除您的bootstrap-jinja
,bootstrap3-jinja
,themes/
主题 - 自v7.0.0起,它们随Nikola一起提供PS。 StackOverflow不是提问的最佳地方;您更有可能在邮件列表上获得答案或在GitHub上报告问题。