title: Jekyll paginate blog as subdirectory
body: <p>I'm using Jekyll for a static site and I'm trying to generate the blog as a subdirectory/subfolder:</p>
  
  <pre><code>http://example.com/blog
  </code></pre>
  
  <p>In the directory structure before running jekyll, this is blog/index.html.</p>
  
  <p>I tried adding pagination by adding "paginate: 5" to _config.yml, but the generated url's were of the form:</p>
  
  <pre><code>http://example.com/page2/
  </code></pre>
  
  <p>i.e. no "/blog".  This is fixed by:</p>
  
  <p>paginate_path: /blog/page/:num</p>
  
  <p>in _config.yml.</p>
  
  <p>But the resulting generated pages at:</p>
  
  <pre><code>http://example.com/blog/page/2/
  </code></pre>
  
  <p>don't use blog/index.html as their layout.  They use the root index.html.  What's the point in even having the paginate_path option, then?</p>
  
  <p>How do I get my blog at example.com/blog, with pagination, using Jekyll?</p>