getnikola / nikola-themes

Themes for Nikola
https://themes.getnikola.com/
70 stars 51 forks source link

[canterville] #160

Open ianbarton opened 6 years ago

ianbarton commented 6 years ago

I am getting the following error on Arch Linux.

Python 3.6.6 Nikola v7.8.15

`Scanning posts...........done! . render_galleries:output/galleries/index.html TaskError - taskid:render_galleries:output/galleries/index.html PythonAction Error Traceback (most recent call last): File "/home/ian/.virtualenvs/nikola/lib/python3.6/site-packages/doit/action.py", line 424, in execute returned_value = self.py_callable(*self.args, kwargs) File "/home/ian/.virtualenvs/nikola/lib/python3.6/site-packages/nikola/plugins/task/galleries.py", line 594, in render_gallery_index self.site.render_template(template_name, output_name, context) File "/home/ian/.virtualenvs/nikola/lib/python3.6/site-packages/nikola/nikola.py", line 1488, in render_template template_name, None, local_context) File "/home/ian/.virtualenvs/nikola/lib/python3.6/site-packages/nikola/plugins/template/mako.py", line 117, in render_template data = template.render_unicode(context) File "/home/ian/.virtualenvs/nikola/lib/python3.6/site-packages/mako/template.py", line 471, in render_unicode as_unicode=True) File "/home/ian/.virtualenvs/nikola/lib/python3.6/site-packages/mako/runtime.py", line 838, in _render *_kwargs_forcallable(callable, data)) File "/home/ian/.virtualenvs/nikola/lib/python3.6/site-packages/mako/runtime.py", line 873, in _render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs) File "/home/ian/.virtualenvs/nikola/lib/python3.6/site-packages/mako/runtime.py", line 899, in _exectemplate callable(context, args, **kwargs) File "/home/ian/Documents/emacs/web_sites/hannah/art/cache/.mako.tmp/base.tmpl.py", line 81, in render_body __M_writer(str(header.html_navigation_links())) File "/home/ian/Documents/emacs/web_sites/hannah/art/cache/.mako.tmp/base_header.tmpl.py", line 123, in render_html_navigation_links if rel_link(permalink, url) == "#": File "/home/ian/.virtualenvs/nikola/lib/python3.6/site-packages/nikola/nikola.py", line 2002, in rel_link dst = urljoin(src, dst) File "/usr/lib64/python3.6/urllib/parse.py", line 488, in urljoin base, url, _coerce_result = _coerce_args(base, url) File "/usr/lib64/python3.6/urllib/parse.py", line 120, in _coerce_args raise TypeError("Cannot mix str and non-str arguments") TypeError: Cannot mix str and non-str arguments

`

Kwpolska commented 6 years ago

What are your NAVIGATION_LINKS?

ianbarton commented 6 years ago

`NAVIGATION_LINKS = { DEFAULT_LANG: ( ("/archive.html", "Archive"), ("/categories/", "Tags"), ("/pages/about/index.html", "About"),

    ((("/pages/parish_council/index.html", "Parish Council"),
      ("/pages/transparency/index.html", "Transparency"),
      ('/pages/meetings/minutes-agendas/index.html', 'Parish Council Meetings and Agendas.')), 'Parish Council'),

    ("/pages/contributing/index.html", "Contributing"),
    ("/pages/contact/index.html", "Contact"),

    #((("/pages/contact/index.html", "Contact"),
    #  ('/pages/meetings/index.html', 'Meetings')), 'Meetings'),

    ("/rss.xml", "RSS feed"),

),

} `

Kwpolska commented 6 years ago

The Canterville theme currently supports one level of navigation links. Patches to make it work with submenus are always welcome.

ianbarton commented 6 years ago

Thanks. However, I still get the error with the default config: `NAVIGATION_LINKS = { DEFAULT_LANG: ( ('/archive.html', 'Archives'), ('/categories/index.html', 'Tags'), ('/rss.xml', 'RSS'), ((('/foo', 'FOO'), ('/bar', 'BAR')), 'BAZ'), ),

} `

Kwpolska commented 6 years ago

You still have some nesting in your example.

ianbarton commented 6 years ago

Thanks, you are quite correct:) Works fine with no nesting.