# Nested includes possible, e.g. for snippets inside info-boxes?

**URL:** <https://talk.jekyllrb.com/t/nested-includes-possible-e-g-for-snippets-inside-info-boxes/4045>\
**Category:** Help\
**Created:** [March 11, 2020, 6:34pm UTC](https://talk.jekyllrb.com/t/nested-includes-possible-e-g-for-snippets-inside-info-boxes/4045 "2020-03-11T18:34:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrian](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@adrian](https://talk.jekyllrb.com/u/adrian)\
**Post date:** [March 11, 2020, 6:34pm UTC](https://talk.jekyllrb.com/t/nested-includes-possible-e-g-for-snippets-inside-info-boxes/4045/1 "2020-03-11T18:34:05Z")

</div>

Hello, I’m new to Jekyll and am looking for a framework to render documentation.

I was wondering if Jekyll is able to render nested includes/snippets. A typical use case are info boxes (“Note”, “Attention”, “Important”, “Warning”) containing some text, which you may be familiar with from online docs.

I saw in the Jekyll docs that these should be no problem with plain Markdown (and probably even HTML) content. But what I’d like to know is whether they may contain includes/snippets themselves.

I haven’t played with Liquid Template syntax yet, so this might be wrong syntax, but I mean something like:

```auto
{% include note.html content="
This is some text and a [link](https://example.com),
but can I use a {% nested.html attrib=foo %} here?
" %}

```

I know that [Hugo](https://gohugo.io) currently cannot handle these, so such info boxes would be limited to a (non-snippet) subset of available elements. Since I’d like to use e.g. smart document references that do some extra checking/processing, that’s almost a deal breaker for me.

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [March 12, 2020, 12:33pm UTC](https://talk.jekyllrb.com/t/nested-includes-possible-e-g-for-snippets-inside-info-boxes/4045/2 "2020-03-12T12:33:03Z")

</div>

I don’t think you can directly add Liquid inside of include parameters, but you can use Liquid’s [`capture` or `assign` tags](https://shopify.github.io/liquid/tags/variable/) to get around this limitation.

Something like this should work.

```auto
{% capture include_content %}
This is some text and a [link](https://example.com),
but can I use a {% include nested.html attrib=foo %} here?
{% endcapture %}

{% include note.html content=include_content %}

```

---

<div class="post-metadata">

**Author:** ![adrian](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@adrian](https://talk.jekyllrb.com/u/adrian)\
**Post date:** [March 13, 2020, 3:34pm UTC](https://talk.jekyllrb.com/t/nested-includes-possible-e-g-for-snippets-inside-info-boxes/4045/3 "2020-03-13T15:34:32Z")

</div>

I see, thanks for the info!
