New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sidebar] Build fails after installing sidebar plugin (again) #234

Closed
KonstantinShemyak opened this Issue Jun 2, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@KonstantinShemyak

KonstantinShemyak commented Jun 2, 2017

(nikola)$ nikola --version
Nikola v7.8.6

The build (of the unchanged site) passes further than in #233 - gets to run sidebar, but still fails:

(nikola)$ nikola build
Scanning posts......done!
.  render_sidebar:output/sidebar-en.inc
########################################
TaskError - taskid:render_sidebar:output/sidebar-en.inc
PythonAction Error
Traceback (most recent call last):
  File "/home/user/nikola/lib/python3.5/site-packages/doit/action.py", line 403, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "/home/user/nikola/lib/python3.5/site-packages/nikola/nikola.py", line 1446, in render_template
    template_name, None, local_context)
  File "/home/user/nikola/lib/python3.5/site-packages/nikola/plugins/template/mako.py", line 117, in render_template
    data = template.render_unicode(**context)
  File "/home/user/nikola/lib/python3.5/site-packages/mako/template.py", line 471, in render_unicode
    as_unicode=True)
  File "/home/user/nikola/lib/python3.5/site-packages/mako/runtime.py", line 838, in _render
    **_kwargs_for_callable(callable_, data))
  File "/home/user/nikola/lib/python3.5/site-packages/mako/runtime.py", line 873, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/home/user/nikola/lib/python3.5/site-packages/mako/runtime.py", line 899, in _exec_template
    callable_(context, *args, **kwargs)
  File "/home/user/nikola/tech-notes.site/cache/.mako.tmp/sidebar.tmpl.py", line 40, in render_body
    __M_writer(str( helper.list_posts(global_posts) ))
  File "/home/user/nikola/tech-notes.site/cache/.mako.tmp/sidebar-helper.tmpl.py", line 37, in render_list_posts
    __M_writer(str( messages("Recent Posts", lang) ))
  File "/home/user/nikola/lib/python3.5/site-packages/nikola/utils.py", line 269, in __call__
    return self[lang][key]
KeyError: 'Recent Posts'

@Kwpolska Kwpolska closed this in b35a644 Jun 2, 2017

@Kwpolska

This comment has been minimized.

Show comment
Hide comment
@Kwpolska

Kwpolska Jun 2, 2017

Member

This is caused by missing messages. The default templates used by the sidebar plugin expect some special messages (translations) to be added, namely:

  • Recent Posts
  • Archives
  • Categories
  • Tags

I added a note to the README. To fix this, you can either create some custom messages files with those entries, or make it untranslatable by modifying sidebar.tmpl and sidebar-helper.tmpl.

(PS. you could have just reopened #233. I assumed this was the only problem in here, but in case an issue still occurs, or you still can’t do what you want, you can always reopen the issue.)

Member

Kwpolska commented Jun 2, 2017

This is caused by missing messages. The default templates used by the sidebar plugin expect some special messages (translations) to be added, namely:

  • Recent Posts
  • Archives
  • Categories
  • Tags

I added a note to the README. To fix this, you can either create some custom messages files with those entries, or make it untranslatable by modifying sidebar.tmpl and sidebar-helper.tmpl.

(PS. you could have just reopened #233. I assumed this was the only problem in here, but in case an issue still occurs, or you still can’t do what you want, you can always reopen the issue.)

@felixfontein

This comment has been minimized.

Show comment
Hide comment
@felixfontein

felixfontein Jun 2, 2017

Contributor

Thanks for updating the documentation (and the plugin metadata)!

Contributor

felixfontein commented Jun 2, 2017

Thanks for updating the documentation (and the plugin metadata)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment