aboutsummaryrefslogtreecommitdiff
path: root/lume/plugins/annotate_year.ts
blob: 39b6e2cc34b7dfd33b00a6628a4862d7a01795a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
import type Site from "lume/core/site.ts";

export default function () {
    return (site: Site) => {
        site.preprocess([".html"], (pages) => {
            for (const page of pages) {
                page.data.year = page.data.date.getFullYear();
            }
        });
    };
}