Commit 5819d1d3 authored by Sylvester Keil's avatar Sylvester Keil

move liquidify to utilities

parent e809c2c9
......@@ -14,24 +14,7 @@ module Jekyll
process(@name)
read_yaml(File.join(base, '_layouts'), config['details_layout'])
liquidify(entry)
end
private
def liquidify(entry)
data['entry'] = {}
data['entry']['key'] = entry.key
data['entry']['type'] = entry.type
data['entry']['bibtex'] = entry.to_s
entry.fields.each do |key, value|
value = value.convert(*bibtex_filters) unless bibtex_filters.empty?
data['entry'][key.to_s] = value.to_s
end
data['entry'] = liquidify(entry)
end
end
......
......@@ -158,7 +158,7 @@ module Jekyll
return missing_reference unless entry
bibliography_template.render({
'entry' => entry,
'entry' => liquidify(entry),
'reference' => reference_tag(entry),
'key' => entry.key,
'type' => entry.type,
......@@ -167,6 +167,22 @@ module Jekyll
})
end
def liquidify(entry)
e = {}
e['key'] = entry.key
e['type'] = entry.type
e['bibtex'] = entry.to_s
entry.fields.each do |key, value|
value = value.convert(*bibtex_filters) unless bibtex_filters.empty?
e[key.to_s] = value.to_s
end
e
end
def generate_details?
site.layouts.key?(File.basename(config['details_layout'], '.html'))
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