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

"[jekyll-webmention_io] Liquid error: internal" error when using includes in Webmention templates #83

Closed
nhoizey opened this issue Jul 25, 2018 · 13 comments

Comments

@nhoizey
Copy link
Contributor

nhoizey commented Jul 25, 2018

I have created a few templates for specific Webmention types:
https://github.com/nhoizey/nicolas-hoizey.com/tree/master/_includes/webmentions

The code for the author avatar is copy/pasted multiple times, so I wanted to share it in an include.

But when I try to serve or build the site, I get this error:

[jekyll-webmention_io] Liquid error: internal

I have to say that I'm currently using version 2.9.1 of this plugin because of incompatible shared dependencies. I'll try to remove the other plugin to test with latest version.

@nhoizey
Copy link
Contributor Author

nhoizey commented Jul 25, 2018

@aarongustafson
Copy link
Owner

Ok weird. I’ll take a look.

Sounds like I need to figure out how to handle includes in includes ;-)

@twhite96
Copy link

@nhoizey how did you get the plugin to work with your templates? Whenever I build the template tags in the head of my blog all have display:none as either an id or class. Not sure what I am doing wrong.

@aarongustafson
Copy link
Owner

I am hitting my head against the wall here. It looks like the Liquid parser needs to know about the other Liquid Tags in the project, which I can get from the site_payload, but I’m not sure how exactly to merge that info and the @DaTa hash in order to get them both resolved into the template. Any help here would be greatly appreciated :-)

@ashmaroli
Copy link
Contributor

@nhoizey Is there any additional info available when you try to build with the above includes via the
--trace option..?

bundle exec jekyll build --trace

@aarongustafson
Copy link
Owner

@ashmaroli Tracing this gives no additional error information in my experience.

Here’s the code I’m using to do the Liquid parsing & rendering:

template = Liquid::Template.parse(@template, :error_mode => :strict)
html = template.render(@data, { :strict_variables => false, :strict_filters => true })

@template contains the default or custom template markup (where the {% include … %} exists. Do I (maybe) need to pass in a reference to the includes folder path or something?

I can’t seem to find any docs on how to do this properly.

@aarongustafson
Copy link
Owner

Worth noting, I tried this with additional liquid tags and get the same error. I tried both highlight and link. Liquid internals like conditionals are not a problem. It leads me to believe the Liquid parser doesn’t have access to the Jekyll instance tags.

@aarongustafson
Copy link
Owner

Yeah, raw works fine.

@ashmaroli
Copy link
Contributor

I tried this with additional liquid tags and get the same error.

Can you provide me with a minimal, reproducible repo that I can use to encounter this error at my end..?
Alternatively, is there any difference in the output if you set Liquid to parse @template with
error_mode => :warn..?

@aarongustafson
Copy link
Owner

I have a local test site I use. It’s a skeleton demo but should work. I don’t have it in Github because there’s no point, but here’s a ZIP of everything but the vendor directory.

test-site.zip

@ashmaroli
Copy link
Contributor

I've traced the bug behind this.. will send a PR shortly..

@nhoizey
Copy link
Contributor Author

nhoizey commented Sep 4, 2018

@twhite96 my build works with my current master branch, but not the one I linked to in the comment before yours.

@aarongustafson
Copy link
Owner

Resolved in 2.9.7.

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

4 participants