inukshuk / jekyll-scholar

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

Sort entries in a query #345

Open michelucci opened 2 years ago

michelucci commented 2 years ago

Hi,

I have a bibtex file with all the references. I want to select some of them with a query, something like

{% bibliography --query @*[topic=mltheory]* %}

I added the topic entry in the bib entries. The selection works, but the order is not correct. In the configuration file I have

scholar:

    last_name: #Michelucci
    first_name: #[Umberto, U.]

    style: apa
    locale: en

    source: /_bibliography/
    bibliography: papers.bib
    bibliography_template: bib #bib
    # Note: if you have latex math in your bibtex, the latex filter
    # preprocessing may conflict with MathJAX if the latter is enabled.
    # See https://github.com/alshedivat/al-folio/issues/357.
    bibtex_filters: [latex, smallcaps, superscript]

    replace_strings: true
    join_strings: true
    #group_by: year
    sorty_by: year, month
    order: descending, descending

    details_dir: bibliography
    details_layout: bibtex.html
    details_link: Details

    query: "@*"

But somehow the query returns a list not order by year. Anyone has any idea why?

Thank you in advance, especially for such a cool tool!

Umberto

inukshuk commented 2 years ago

Not sure, but if you copied the configuration above verbatim from your file then there's a typo in sorty_by_year.

george-gca commented 9 months ago

This is currently an issue for me. For example, when I do this giving the papers.bib:

{% bibliography -f {{ site.scholar.bibliography }} --group_by none --query @*[selected=true]* %}

it correctly selects only the entries that have selected={true} in it.

image

But when I do

{% bibliography -f {{ site.scholar.bibliography }} --group_by none --sort_by year,month --order descending --query @*[selected=true]* %}

it fails to filter the entries, returning all of them.

image

Also the order is right besides the last one, that is actually the newest one. I tested this in this template.