inukshuk / jekyll-scholar

jekyll extensions for the blogging scholar
MIT License
1.12k stars 102 forks source link

Remove use_raw_bibtex_entry option #274

Closed stevecheckoway closed 4 years ago

stevecheckoway commented 4 years ago

Jekyll 4 does not render Liquid markup from included BibTeX files any longer. This obviates the need for adding {%raw%} around an entry's bibtex field. Indeed, adding it causes {%raw%} and {%endraw%} to appear in the output.

This commit adds a warning if the use_raw_bibtex_entry key appears in the jekyll-scholar options, regardless of the value of the entry.

stevecheckoway commented 4 years ago

This is a follow up to the discussion in #273.

dirteat commented 4 years ago

Hi there, just updated to jekyll 4, I used to have use_raw_bibtex_entry to true and all things related to jekyll-scholar are now broken :(

For instance, I cannot make {% bibliography --file something.bib %} to work anymore, it seems to pick a random .bib file among the many I have.

Edit: More specifically, this does not work anymore:

{% bibliography --file {{ member.bibfile }} %}

I really do need to pass a variable to the option --file !

PS: I have already removed all yaml header in .bib file, which otherwise trigger errors with the {{}} bibtex entry.

Any advice welcome, I cannot find anything in the changelog that would explain this. Thanks!

stevecheckoway commented 4 years ago

@dirteat it's probably best to file an issue.

I'm a little surprised that ever worked though. My recollection of how Liquid markup works is that your updated example should call whichever function was registered for bibliography and then it would get --file {{ member.bibfile }} as an argument and it would be responsible for parsing that. In particular, I wouldn't expect it to do more liquid rendering on it to produce a file name.

dirteat commented 4 years ago

Ok, I'll open a new issue. I reverted back to jekyll 3.8.6 and jekyll-scholar 5.16.0, and that really works.

The website is actually: https://curl.group

you can check the output on "members" menu, each get his own biblio generated by {% bibliography --file {{ member.bibfile }} %} where member.bibfile is defined in some markdown text file for each "member".

inukshuk commented 4 years ago

My recollection of how Liquid markup works is that your updated example should call whichever function was registered for bibliography and then it would get --file {{ member.bibfile }} as an argument and it would be responsible for parsing that. In particular, I wouldn't expect it to do more liquid rendering on it to produce a file name.

Yes, jekyll-scholar interpolates the parameters additionally.

This is probably unrelated to the raw bibtex option? Or is the whole thing {% bibliography ... %} embedded in a bibtex file?

dirteat commented 4 years ago

You're right, it is unrelated to raw bibtex; I deactivated the option in scholar 5.16.0 / jekyll 3.8.6 and everything works fine. The whole thing is in a layout, not in a bibtex file. I've open a new issue about it.

inukshuk commented 4 years ago

Hmm, it's possible that the fact that it is in the layout is the cause of the problem. Maybe jekyll changed something about the way the layout is evaluated. You say above that the interpolation happens just once (one file is picked) so maybe that's some kind of optimization jekyll does: render that part of the layout and then re-use the result. You would have to make sure that this part of the layout is rendered every time the member variable changes.