mslinn/jekyll_flexible_include_plugin

Ruby type conversion Error

georgenaufrago opened this issue · 7 comments

Hi! I'm getting the follow error using Jekyll 4.0.0

_plugins/include_absolute.rb:130:in `render'
/srv/decus-jk/_plugins/include_absolute.rb:130:in `join': no implicit conversion of nil into String (TypeError)

I am using Jekyll 4.1.1 and I have the same error... #2

You are referencing the wrong plugin. The name of this plugin was changed from include_absolute to flexible_include, as described in README.md. Please update your HTML file(s).

That bug was in the previous version before I started working on flexible_include. I believe I fixed that in my private version some time ago. I just checked in that version. Please let me know if that solves the problem.

Thanks for checking in, Mike. The problem is gone after updating the plugin code.

Note for others, who might find this thread confusing: @georgenaufrago had reported an HTML escape problem in a comment, but deleted that comment after the update fixed his problem. This is what he had posted:

I've just updated the flexible_include.rb source code to the latest version
in the repository. Now the plugin does include files, specifically those
outside the Jekyll project dir, without any type conversion errors. There
seems to be another bug though: the included file gets some characters
HTML-escaped, which makes the included HTML markup invalid. Here's a
snippet from my last test output:

<a class="post-share-link" href="../" style="text-transform: none;"><i
class="fas fa-arrow-left"></i>&nbsp;Back to Blog</a> </div> <!--
THAT'S WHERE {% flexible_include %} IS IN THE SOURCE CODE --> <!--
NOTE that the '<' character as well as '{' and '}' (Vue.js double
moustache syntax) get HTML-escaped in the output --> &lt;div
:class="&#123; 'collapsible-text' : true, 'collapsed' :
!expanded &#125;" ref="container" >
&lt;slot>&lt;/slot> &lt;div class="switch" ref="switch" >
&lt;a @click="switchState" class="collapsible-text-switch">
&lt;i :class="('fa ' + (expanding ? 'fa-spinner fa-spin'
: expanded ? 'fa-chevron-up'
: 'fa-chevron-down'))">&lt;/i>
&#123;&#123; expanded ? 'Show less' : 'Show more' &#125;&#125;
&lt;/a> &lt;/div>&lt;/div>

No worries! In the future:

  1. You might want to minimize rewriting or deleting history. As for edits, well, I hardly write any comment that I don't edit at least twice. Usually, edits should not fundamentally alter the nature of a published comment that has been replied to.

  2. Please open a new ticket for each issue.

For now, no need to do anything. Have a great weekend.