Jekyll-Disqus Ruby gem

Jekyll-Disqus is a Ruby library for the Jekll HTML static website generator that provides two couple of Liquid tags to print the HTML and Javascript code required to visualize the Disqus counter and comment box.

It calculates the IDs to associate to each content using the publishing date, and where not available, a custom ID to write in the front matter.

The library also prevent the IDs duplication raising an error when it is detected.

  • Name:
    Jekyll-Disqus
  • Language:
    Ruby
  • Type:
    Ruby library for Jekyll
  • License:
    GPL v.3
  • Platform:
    Linux, Windows
  • Requirements:
    Ruby, Jekyll
  • First release:
    1.0.0 (March 06, 2023)
  • Current release:
    1.0.1 (March 13, 2023)
  • Links:

Main Features

  • Print the codes to display the Disqus comments counter and comment box inside a Liquid layout;
  • provides two couple of tags to cover both the HTML and Javascript code for each object;
  • the layouts where to effectively print the codes can be selected in the config file;
  • an ID prefix can be set up in the config file;
  • all the Disqus ID used are mapped to avoid any duplication;
  • where possibile the publishing date will be automatically used to create the Disqus ID;
  • a custom ID can be specified for each content in the front matter;
  • a content can be excluded using a proper flag in the front matter.

Installation

With Bundler

$ bundle add jekyll-disqus-plugin --group jekyll_plugins

Configuration

  1. Be sure that jekyll-disqus-plugin gem is in the :jekyll_plugins group:
    group :jekyll_plugins do
      ...
      gem 'jekyll-disqus-plugin'
    end
    
    
  2. in the _config file copy and paste the code below:
    jekyll-disqus:
      shortname:
      id_prefix: 
      post_selector: 'include.post'
      ui:
        layouts:
        - 'post'
      counter:
        layouts:
        - 'all'
    
    

Articles on FreeAptitude

Changelog

Version 1.0.1 (March 13, 2023)

  • Fixed the symbol references in the DuplicatedDisqusId#initialize method.

Version 1.0.0 (March 06, 2023)

  • First public release.



Leave a Comment