inukshuk / jekyll-scholar

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

Question: Numbering of <ol> elements when grouping #300

Closed haji-ali closed 4 years ago

haji-ali commented 4 years ago

I have my publications sets up to be grouped by year. However, I still want to have the numbering of the references to be sequential. At the moment the numbering resets within each group. Any idea how best to achieve this?

haji-ali commented 4 years ago

I now learned that this can be done in CSS. Leaving it here for others.

div.bibliography-container {
    counter-reset: bibitem;
    ol li {
        counter-increment: bibitem;
        padding: 0 0 0 .3em;
    }
    ol li::marker {
        content: counter(bibitem) ".";
        font-weight: bold;
    }
}
haji-ali commented 4 years ago

I realized this is not a very portable solution (across browsers). Is there a way to implement this by controlling the more standard start property of <ol>.