inukshuk / jekyll-scholar

jekyll extensions for the blogging scholar
MIT License
1.13k stars 101 forks source link

Query to filter entries based on the value of a field #343

Closed cmas1 closed 2 years ago

cmas1 commented 2 years ago

Hi,

in my bib file I have added to all items a field to tag the research project the publication belongs to, that is @book{item1, title = {Carpe Diem}, project = {project_1}, author = {John Doe}, year = {2008} }

Now, I can query the items belonging to this project as {% bibliography --query @[project=project_1] %}

However, there can be items that are associated to multiple projects, such as @book{item2, title = {Lorem ipsum}, project = {project_1,project_2}, author = {John Doe}, year = {2008} }

and these items are not captured by the filter above. I assume that I would have to use some regular expression or parse the field into tokens. Is there a way to modify the query to do this?

cmas1 commented 2 years ago

Ok, I found a solution thanks to the reply to this issue https://github.com/inukshuk/jekyll-scholar/issues/249

I just had to write {% bibliography --query @[project~=project_1] %} to make it work