From f521c0ae5c15468fa39da9f9eebcbda461afd7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Fuch=C3=9F?= Date: Fri, 2 Jan 2026 23:56:18 +0100 Subject: [PATCH] Fix: bibliography month persists to subsequent entries without month (#3391) Fixes #3386 (the part about the wrong months; the other part (layouting of bibtex) is fixed in #3387) ## Summary - Fixes incorrect month shown for bibliography entries that do not specify a `month` in BibTeX. - Ensures `month`/`year` do not persist between entries in `_layouts/bib.liquid`. ## Root Cause - In Liquid, captured variables persist across iterations if not reinitialized. - `entrymonth` and `entryyear` were only set when `entry.month`/`entry.year` existed, causing values from a previous entry to leak into the next one when those fields were missing. ## Changes - Reinitialize date-related variables per entry before conditional captures: ## Behavior - Before: Entries without a `month` could display the previous entry's month. - After: Entries without a `month` display only the `year`; entries with a `month` display the correct month and year. image --- _layouts/bib.liquid | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_layouts/bib.liquid b/_layouts/bib.liquid index a4c693f..db179fd 100644 --- a/_layouts/bib.liquid +++ b/_layouts/bib.liquid @@ -160,9 +160,11 @@ {% else %} {% capture entrytype %}{% endcapture %} {% endif %} + {% assign entrymonth = '' %} {% if entry.month %} {% capture entrymonth %}{{ " " }}{{ entry.month | capitalize }}{% endcapture %} {% endif %} + {% assign entryyear = '' %} {% if entry.year %} {% capture entryyear %}{{ " " }}{{ entry.year }}{% endcapture %} {% endif %}