For creating a blog index in kerouac
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
LICENSE
README.md
package.json

README.md

kerouac-blog-index

For creating a blog index in kerouac.

Usage

In site.js, using a default layout:

site.plug(require('kerouac-blog')('blog', { layout: 'blog' }));
site.plug(require('kerouac-blog-index')('blog'));

Using a custom layout:

site.plug(require('kerouac-blog')('blog', { layout: 'blog' }));
site.plug(require('kerouac-blog-index')('blog', { layout: 'blog-index' }));

Layouts

A default layout is suplied and used by default. Custom layouts can be defined as well, example:

<% layout('../layout') -%>

<section>
	<ul class="posts">
	  <% posts.forEach(function(post){ %>
	    <li><a href="<%- post.url -%>"><%- post.title || post.url -%></a></li>
	  <% }) %>
	</ul>
</section>