Commit e342b628 authored by Sylvester Keil's avatar Sylvester Keil

add option for string replacement

fixes #37
parent 185d21f2
...@@ -41,6 +41,8 @@ default configuration is as follows: ...@@ -41,6 +41,8 @@ default configuration is as follows:
bibliography: references.bib bibliography: references.bib
bibliography_template: "%{reference}" bibliography_template: "%{reference}"
replace_strings: true
details_dir: bibliography details_dir: bibliography
details_layout: bibtex.html details_layout: bibtex.html
details_link: Details details_link: Details
......
...@@ -13,6 +13,8 @@ module Jekyll ...@@ -13,6 +13,8 @@ module Jekyll
'bibtex_options' => { :strip => false }, 'bibtex_options' => { :strip => false },
'bibtex_filters' => [ :latex ], 'bibtex_filters' => [ :latex ],
'replace_strings' => true,
'details_dir' => 'bibliography', 'details_dir' => 'bibliography',
'details_layout' => 'bibtex.html', 'details_layout' => 'bibtex.html',
'details_link' => 'Details', 'details_link' => 'Details',
......
...@@ -56,7 +56,12 @@ module Jekyll ...@@ -56,7 +56,12 @@ module Jekyll
end end
def bibliography def bibliography
@bibliography ||= BibTeX.open(bibtex_path, bibtex_options) unless @bibliography
@bibliography = BibTeX.open(bibtex_path, bibtex_options)
@bibliography.replace_strings if replace_strings?
end
@bibliography
end end
def entries def entries
...@@ -70,6 +75,10 @@ module Jekyll ...@@ -70,6 +75,10 @@ module Jekyll
b b
end end
def replace_strings?
config['replace_strings']
end
def cited_only? def cited_only?
!!@cited !!@cited
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