Skip to content

Commit d1e19e0

Browse files
committed
Add reverse numbering (continuous across years)
1 parent af98ce0 commit d1e19e0

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

_pages/publications.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ toc: true
66
toc_sticky: true
77
---
88

9+
<script>
10+
document.addEventListener('DOMContentLoaded', function() {
11+
var total = document.querySelectorAll('ol.bibliography li').length + 1;
12+
document.querySelector('.page__content').style.counterReset = 'publication ' + total;
13+
});
14+
</script>
15+
916
## 2025
1017
{% bibliography --query @*[year=2025] %}
1118

assets/css/main.scss

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,21 @@ search: false
2222
ol.bibliography {
2323
font-size: 0.75em;
2424
line-height: 1.4;
25+
list-style: none;
26+
padding-left: 2.5em;
2527

2628
li {
27-
list-style: decimal;
29+
counter-increment: publication -1;
2830
margin-bottom: 0.75em;
31+
position: relative;
32+
33+
&::before {
34+
content: counter(publication) ".";
35+
position: absolute;
36+
left: -2.5em;
37+
width: 2em;
38+
text-align: right;
39+
}
2940
}
3041

3142
.pub-note {

0 commit comments

Comments
 (0)