noroot / jekyll-mail-comments

Email based comment system for Jekyll static site generator
1 stars 0 forks source link
comments email imap jekyll mail

Jekyll Mail comments

This gem fetches email from your mailbox by filtering with specific suffix, it makes data files which you can use to generate Jekyll comments.

How it works ?

What is the purpose ?

How-to Setup

There few credentials your have to setup before run:

MC_LOGIN - Login to imap server MC_PASSWORD - Password for imap server MC_HOST - IMAP server hostname MC_PORT - IMAP server port ** MC_SUBJECT_SUFFIX - Suffix to filter comments

After that if new comments are present it will generate data files with comments which you can process with Jekyll with data tag. See here. https://jekyllrb.com/docs/datafiles/ or below.

Here is how to you can include comments block into your Jekyll post template


    <section>
        {% include comments-count.html replies_to=page.path %}

        {% if comment_count %}
        <h2>Comments ({{- comment_count -}}) <small class="text-muted">Read carefuly </small> </h2>
        {% include comments.html replies_to=page.path indent_class="ml-auto" title=page.title %}
        {% else %}
        <h2>No comments here yet <small class="text-muted">Write here gently</small></h2>
        {% endif %}
        <div class="mt-3"><a class="btn btn-outline-secondary btn-block" href="https://github.com/noroot/jekyll-mail-comments/blob/master/mailto:{{site.comments.email}}?subject=RE:{{page.path}}:{{site.comments.subject_suffix}}:{{page.title}}">Write a comment</a> </div>
    </section>

Templates can be found inside templates directory of this gem.

Credits

Inspiration while searching for already existing gem for email comments

Example