0.1.0 • Published 6 years ago
kensei v0.1.0
Kensei
It's a small client library to host a blog on github.io.
It was inspired by jekyll.
It is depending on showdown.
How to use
- Create an index.html
- Add this container html snippet
<div id="content"></div>
- Add the script for kensei
<script src="https://rawgit.com/chrisakakay/kensei/master/dist/kensei.bundle.js"></script>
- Create a small initialization script
var posts = [
{
date: '2018-01-01',
short: 'my-new-blog',
title: 'My new blog',
desc: 'I gonna share funny stories here or discuss React vs Angular stuff ..'
}
];
Kensei.app.init({ posts: posts });
- Create a posts folder
- And create the posts you added in the posts variable (ex: 2018-01-01-my-new-blog.md)
- Thats it
Notes
The bundle kensei.bundle.js contains showdown by default.
You can use kense.min.js which is just the kensei library, but you have to include showdown yourself.
Showdown version 1.4.3 because it is small.
API
Kensei.app.init can take some options like:
- posts (an array of the visible posts)
- container (optional, container for the posts to be rendered in, ex.: document.getElementById('my-container'))
- pagination.postPerPage (optional, default is 4)
- disqus.pageUrl (optional)
- disqus.disqusId (optional)
0.1.0
6 years ago