Skip to content
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

[srcco.de] TemplateModule object' has no attribute 'open_graph_metadata' #214

Open
Suleman-Elahi opened this issue Jan 7, 2023 · 0 comments

Comments

@Suleman-Elahi
Copy link

Suleman-Elahi commented Jan 7, 2023

Faced the above error about unhandled exception after installing the Srcco.de theme.

After installing the theme when I issue 'build' command, the same errors is shown.

(nikola) PS D:\nikola\site> nikola theme -i srcco.de
[2023-01-07 12:50:33] INFO: theme: Downloading 'https://themes.getnikola.com/v7/srcco.de.zip'
[2023-01-07 12:50:33] INFO: theme: Extracting 'srcco.de' into themes/
[2023-01-07 12:50:33] INFO: theme: Remember to set THEME="srcco.de" in conf.py to use this theme.
(nikola) PS D:\nikola\site> nikola build
Scanning posts........done!
.  render_galleries:output\galleries\index.html
.  render_galleries:output\galleries\rss.xml
.  render_galleries:output\galleries\demo\index.html
TaskError - taskid:render_galleries:output\galleries\demo\index.html
PythonAction Error
Traceback (most recent call last):
  File "D:\nikola\lib\site-packages\doit\action.py", line 461, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "D:\nikola\lib\site-packages\nikola\plugins\task\galleries.py", line 717, in render_gallery_index
    self.site.render_template(template_name, output_name, context)
  File "D:\nikola\lib\site-packages\nikola\nikola.py", line 1487, in render_template
    data = self.template_system.render_template(
  File "D:\nikola\lib\site-packages\nikola\plugins\template\jinja.py", line 98, in render_template
    data = template.render(**context)
  File "D:\nikola\lib\site-packages\jinja2\environment.py", line 1301, in render
    self.environment.handle_exception()
  File "D:\nikola\lib\site-packages\jinja2\environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "D:\nikola\lib\site-packages\nikola\data\themes\base-jinja\templates\gallery.tmpl", line 5, in top-level template code
    {% import 'post_helper.tmpl' as post_helper with context %}
  File "themes\srcco.de\templates\base.tmpl", line 9, in top-level template code
    {% block extra_head %}
  File "D:\nikola\lib\site-packages\nikola\data\themes\base-jinja\templates\gallery.tmpl", line 77, in block 'extra_head'    {{ post_helper.open_graph_metadata(post) }}
  File "D:\nikola\lib\site-packages\jinja2\utils.py", line 83, in from_obj
    if hasattr(obj, "jinja_pass_arg"):
jinja2.exceptions.UndefinedError: 'jinja2.environment.TemplateModule object' has no attribute 'open_graph_metadata'

########################################
render_galleries:output\galleries\demo\index.html <stdout>:

How to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant