Commit 896f6ac8 authored by Sylvester Keil's avatar Sylvester Keil

compare bibtex values for improved sorting

see #77
parent df336332
...@@ -28,7 +28,7 @@ Gem::Specification.new do |s| ...@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency('jekyll', '~> 2.0') s.add_runtime_dependency('jekyll', '~> 2.0')
s.add_runtime_dependency('citeproc-ruby', '~> 1.0') s.add_runtime_dependency('citeproc-ruby', '~> 1.0')
s.add_runtime_dependency('csl-styles', '~> 1.0') s.add_runtime_dependency('csl-styles', '~> 1.0')
s.add_runtime_dependency('bibtex-ruby', '~> 4.0', '>= 4.0.8') s.add_runtime_dependency('bibtex-ruby', '~> 4.0', '>= 4.0.9')
s.files = `git ls-files`.split("\n") s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
......
...@@ -141,10 +141,7 @@ module Jekyll ...@@ -141,10 +141,7 @@ module Jekyll
def sort(unsorted) def sort(unsorted)
return unsorted if skip_sort? return unsorted if skip_sort?
sorted = unsorted.sort_by { |e| sorted = unsorted.sort_by { |e| e.values_at(*sort_keys) }
e.values_at(*sort_keys).map { |v| v && v.v }
}
sorted.reverse! if config['order'] =~ /^(desc|reverse)/i sorted.reverse! if config['order'] =~ /^(desc|reverse)/i
sorted sorted
end 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