how to add Liquid inside of span-level elements

29 views
Skip to first unread message

Tom Johnson

unread,
Jun 16, 2016, 2:17:41 PM6/16/16
to kramdown-users
I'm having trouble adding Liquid syntax inside of includes that have span-level elements within my Jekyll project.

I have an include called note.html that looks like this:

<div markdown="span" class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> {{include.content}}</div>

On a page, I use the include like this:

{% include note.html content="This is a sample note." %}

It works fine.

However, if I try to put Liquid syntax inside the content parameter, I get an error. Here's an example:

{% include note.html content="This is a sample note and {{site.description}}" %}

The error on the command line shows this:

Liquid Exception: Invalid syntax for include tag. File contains invalid characters or sequences: note.html content="This is a sample note and Intended as a documentation theme based on Jekyll for technical writers documenting software and other technical products, this theme has all the elements you would need to handle multiple products with both multi-level sidebar navigation, tags, and other documentation features." Valid syntax: {% include file.ext param='value' param2='value' %} in index.md
...error:
 
However, if I avoid using the include but instead just insert the include's content directly, it works. Here's an example:

<div markdown="span" class="alert alert-info" role="alert"><i class="fa fa-info-circle"></i> <b>Note:</b> This is a sample note and {{site.description}}</div>

No error results.

Why is this Liquid syntax resulting in the error when I use includes?

Tom


Tom Johnson

unread,
Jun 16, 2016, 2:20:41 PM6/16/16
to kramdown-users
Sorry, I think this question is more specific to Jekyll than Kramdown. Maybe Jekyll doesn't allow Liquid syntax with include parameters. Does Kramdown restrict this, or is it totally independent?

Thomas Leitner

unread,
Jun 16, 2016, 4:00:37 PM6/16/16
to kramdow...@googlegroups.com
Please ask someone from Jekyll as they know how this is implemented -
thanks.

-- Thomas

Tom Johnson

unread,
Jun 18, 2016, 12:02:59 AM6/18/16
to kramdow...@googlegroups.com
Thanks. Someone helped me sort it out (https://talk.jekyllrb.com/t/do-parameters-for-includes-allow-liquid-syntax/2536/3). It was a Jekyll issue, not a kramdown issue. My fault. I appreciate your response.

Tom

---------------------
blog: idratherbewriting.com
twitter: tomjohnson


--
You received this message because you are subscribed to a topic in the Google Groups "kramdown-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kramdown-users/AqbCZmKDC0M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kramdown-user...@googlegroups.com.
To post to this group, send email to kramdow...@googlegroups.com.
Visit this group at https://groups.google.com/group/kramdown-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages