Commit 89f21399 authored by Sylvester Keil's avatar Sylvester Keil

support skip fields for bibtex export

see #78
parent 896f6ac8
......@@ -497,7 +497,7 @@ License
Jekyll-Scholar is distributed under the same license as Jekyll.
Copyright (c) 2011-2014 [Sylvester Keil](http://sylvester.keil.or.at/)
Copyright (c) 2011-2015 [Sylvester Keil](http://sylvester.keil.or.at/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
......
......@@ -15,6 +15,7 @@ module Jekyll
'bibtex_options' => { :strip => false, :parse_months => true },
'bibtex_filters' => [ :latex ],
'bibtex_skip_fields' => [ :abstract, :month_numeric ],
'replace_strings' => true,
'join_strings' => true,
......
......@@ -275,12 +275,16 @@ module Jekyll
e['key'] = entry.key
e['type'] = entry.type.to_s
if entry.field?(:abstract)
if entry.field_names(config['bibtex_skip_fields']).empty?
e['bibtex'] = entry.to_s
else
tmp = entry.dup
tmp.delete :abstract
config['bibtex_skip_fields'].each do |name|
tmp.delete name if tmp.field?(name)
end
e['bibtex'] = tmp.to_s
else
e['bibtex'] = entry.to_s
end
entry.fields.each do |key, value|
......@@ -291,6 +295,9 @@ module Jekyll
e
end
def bibtex_skip_fields
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