Added bibtex filter to hide custom bibtex keywords from bib file output (#652)
This commit is contained in:
parent
e5c1012aeb
commit
c4e170a545
@ -237,6 +237,7 @@ scholar:
|
||||
|
||||
query: "@*"
|
||||
|
||||
filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, selected, supp, blog, code, poster, slides, website] # Filter out certain bibtex entry keywords used internally from the bib output
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Responsive WebP Images
|
||||
|
@ -153,7 +153,7 @@
|
||||
{% if entry.bibtex_show -%}
|
||||
<!-- Hidden bibtex block -->
|
||||
<div class="bibtex hidden">
|
||||
{% highlight bibtex %}{{ entry.bibtex }}{% endhighlight %}
|
||||
{% highlight bibtex %}{{ entry.bibtex | hideCustomBibtex }}{% endhighlight %}
|
||||
</div>
|
||||
{%- endif %}
|
||||
</div>
|
||||
|
15
_plugins/hideCustomBibtex.rb
Normal file
15
_plugins/hideCustomBibtex.rb
Normal file
@ -0,0 +1,15 @@
|
||||
module Jekyll
|
||||
module HideCustomBibtex
|
||||
def hideCustomBibtex(input)
|
||||
keywords = @context.registers[:site].config['filtered_bibtex_keywords']
|
||||
|
||||
keywords.each do |keyword|
|
||||
input = input.gsub(/^.*#{keyword}.*$\n/, '')
|
||||
end
|
||||
|
||||
return input
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_filter(Jekyll::HideCustomBibtex)
|
Loading…
Reference in New Issue
Block a user