like button for posts in jekyll

Short answer: you can't.

Long answer: your button will have store the "likes" somewhere (usually a database), which is by definition a dynamic process. Jekyll can only generates static data.

You can bind your button to an external service, e.g. LikeBtn which provides such functionality (the free offer miss advanced features like statistics).

Whatever the service you choose, it will usually work by adding a javascript snippet, as with google analytics. You can see how to use google analytics with jekyll to help you (e.g. here).

Tags:

Blogs

Jekyll