Commit d0bd2541 authored by Hiren Patel's avatar Hiren Patel

Parameter for text in cite_details

parent 8d04c74f
......@@ -4,18 +4,19 @@ module Jekyll
class CiteDetailsTag < Liquid::Tag
include Scholar::Utilities
attr_reader :key, :pages
attr_reader :key, :text
def initialize(tag_name, arguments, tokens)
super
@config = Scholar.defaults.dup
@key = arguments.strip.split(/\s+/)[0]
@key = arguments.strip.split(/\s+/,2)[0]
@text = arguments.strip.split(/\s+/,2)[1]
end
def render(context)
set_context_to context
cite_details key
cite_details key, text
end
end
......
......@@ -80,11 +80,11 @@ module Jekyll
"(#{key})"
end
def cite_details(key)
def cite_details(key, text)
entry = bibliography[key]
if bibliography.key?(key)
link_to details_link_for(entry), "More details."
link_to details_link_for(entry), text
else
"(missing reference)"
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