title: Check if variable is type of string or array in liquid
body: <p>In Jekyll you can use <a href="https://shopify.github.io/liquid/" rel="noreferrer">liquid template</a> and I am trying to write a nav that includes all links in the website.</p>
  
  <pre><code>sitemap:
    home: "/"
    demo:
      right: "/right"
      left: "/left"
  </code></pre>
  
  <p>What I am trying to achieve is to create a sidebar that icludes all those links. But certains links are under a section. The output should be the following</p>
  
  <pre><code>&lt;nav&gt;
    &lt;ul&gt;
      &lt;li&gt;
        &lt;a href="/"&gt;home&lt;/a&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  
    &lt;ul&gt;
      &lt;li&gt;demo&lt;/li&gt;
      &lt;li&gt;
        &lt;a href="/right"&gt;right&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;a href="/left"&gt;left&lt;/a&gt;
      &lt;/li
    &lt;/ul&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p>Not all sections must have a title. The home link is a standalone link.
  The demo links are all in the demo section.</p>
  
  <p>In liquid I can loop through the sitemap in this way:</p>
  
  <pre><code>{% for nav in site.sitemap %}
  &lt;ul&gt;
    &lt;li&gt;{{ nav[0] }}&lt;/li&gt;
  &lt;/ul&gt;
  {% endfor %}
  </code></pre>
  
  <p>In this way, liquid will print <code>home</code> and <code>demo</code>.</p>
  
  <p>What I need is to check if the <strong>value</strong> is a string or an array in order to print the array or a single link!</p>
  
  <p><strong>Is there a way to check if the liquid variable is a string or an array?</strong>
  I can't find it in the documentation i linked before!</p>