title: How can I compare a string's size / length in Jekyll's Liquid templates?
body: <p>I am using Jekyll on GitHub Pages in order to build a blog and am wanting to get the length of the <code>page.title</code> string passed to the Liquid Template in the YAML front matter in each post. I have not been able to figure out an easy way to do this. Looking at the <a href="https://github.com/Shopify/liquid/wiki/Liquid-for-Designers" rel="noreferrer">Liquid For Designers Guide</a> I was able to see that it supports two types of markup:</p>
  
  <ul>
  <li><p><strong>Output Markup</strong> - Delimited by double curly braces <code>{{ }}</code>, you can output variables that are passed to your template, either in the YAML front matter such as <code>page.title</code> in Jekyll, or the global site level variables in <code>_config.yml</code>. In order to output the title of the post or page you would use <code>{{ page.title }}</code>.</p></li>
  <li><p><strong>Tag Markup</strong> - Delimited by curly braces and percents <code>{% %}</code>, these are used for logic in your templates. If statements, loops, that type of thing.</p></li>
  </ul>
  
  <p>Apparently there are lots of filters you can use with the Output Markup and you can output the length of a string passed to the template by using <code>{{ page.title | size }}</code>. </p>
  
  <p>However, what I would like to do in my template is render the title of the page using either an <code>&lt;h1&gt;</code>,<code>&lt;h2&gt;</code>, or <code>&lt;h3&gt;</code> header depending on the length of the title.</p>
  
  <p>I can not figure out anyway to mix the tag markup and the output markup. </p>
  
  <p>I can output the size of <code>page.title</code> onto the page with <code>{{ page.title | size }}</code>, I cannot, however, figure out how to use the length in an if statement. This also returns a string representation and not a number.</p>
  
  <p>Does anyone with more experience with Liquid know how to do this?</p>
  
  <p>Ideally, what I would like to do is something along the lines of this:</p>
  
  <pre><code>{% if page.title | size &gt; 5 %} 
  </code></pre>