title: how to pad a string in jekyll?
body: <p>Say I'm incrementing an integer like this</p>
  
  <pre><code> {% capture page %}{{ page | plus: '1' }}{% endcapture %}
  </code></pre>
  
  <p>How could I pad it like this?</p>
  
  <pre><code> {% capture paddedPage %}{{ page | pad '0', 4 }}{% endcapture %}
  </code></pre>
  
  <p>where 4 is number of padding places, and '0' is the padding string? The end result would look like this: <code>0001</code> where the value of page is 1. How might I do this inline or in a filter?</p>
  
  <p>I guess it could be <em>represented</em> like sprintf( '%d4', page ) but obviously this syntax does not work with liquid/jekyll.</p>
  
  <p>I'm growing really disappointed in jekyll/liquid syntax (does not even have native modulus!) That aside, how might I pad a string with leading characters?</p>