Sha256: cb149f46ccbc3cd42dd9aca9ff82aa3889f157cd2141e0e8df138acbe2dbdb25

Contents?: true

Size: 493 Bytes

Versions: 3

Compression:

Stored size: 493 Bytes

Contents

module Jekyll
  module Zettel
    # Liquid tag that renders the reference the Zettel is based on
    class Reference < Liquid::Tag

      def render(context)
        doc = context.registers[:page]
        return unless doc.key?('reference') && doc['reference'].key?('citation-key')

        context.registers[:site].config['citeproc'].render :bibliography, id: doc['reference']['citation-key']
      end
    end
  end
end

Liquid::Template.register_tag('reference', Jekyll::Zettel::Reference)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jekyll-zettel-0.7.2 lib/jekyll/zettel/reference.rb
jekyll-zettel-0.7.1 lib/jekyll/zettel/reference.rb
jekyll-zettel-0.7.0 lib/jekyll/zettel/reference.rb