Commit 98733791 authored by Hiren Patel's avatar Hiren Patel

Add cite_details tag

parent 3dd51beb
......@@ -11,5 +11,6 @@ require 'jekyll/scholar/utilities'
require 'jekyll/scholar/converters/bibtex'
require 'jekyll/scholar/tags/bibliography'
require 'jekyll/scholar/tags/cite'
require 'jekyll/scholar/tags/cite_details'
require 'jekyll/scholar/tags/quote'
require 'jekyll/scholar/generators/details'
module Jekyll
class Scholar
class CiteDetailsTag < Liquid::Tag
include Scholar::Utilities
attr_reader :key, :pages
def initialize(tag_name, arguments, tokens)
super
@config = Scholar.defaults.dup
@key = arguments.strip.split(/\s+/)[0]
end
def render(context)
set_context_to context
cite_details key
end
end
end
end
Liquid::Template.register_tag('cite_details', Jekyll::Scholar::CiteDetailsTag)
......@@ -79,6 +79,14 @@ module Jekyll
rescue
"(#{key})"
end
def cite_details(key)
entry = bibliography[key]
if bibliography.key?(key)
link_to "More details.", details_link_for(entry)
end
end
def content_tag(name, content_or_attributes, attributes = {})
if content_or_attributes.is_a?(Hash)
......@@ -108,4 +116,4 @@ module Jekyll
end
end
end
\ No newline at end of file
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment