From 1c9bf1d1e13959d177cff817837bf9a41a93b15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=97=8D+85CD?= <50108258+kwaa@users.noreply.github.com> Date: Mon, 29 Apr 2024 21:43:00 +0800 Subject: [PATCH 1/2] fix(plugin/fff): fix `getGitDate` priority --- plugins/fff.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/fff.ts b/plugins/fff.ts index fcf866c2..bb836dcf 100644 --- a/plugins/fff.ts +++ b/plugins/fff.ts @@ -35,8 +35,12 @@ export default function (userOptions?: Partial) { site.preprocess(options.extensions, (pages) => pages.forEach((page) => { if (options.getGitDate && page.src.entry) { - page.data.created = getGitDate("created", page.src.entry.src); - page.data.updated = getGitDate("modified", page.src.entry.src); + if (!page.data.created) { + page.data.created = getGitDate("created", page.src.entry.src); + } + if (!page.data.updated) { + page.data.updated = getGitDate("modified", page.src.entry.src); + } } page.data = transform(page.data, [ From 6c507cd5fb447ed12ce40bc61993c75bf6206b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=97=8D+85CD?= <50108258+kwaa@users.noreply.github.com> Date: Mon, 29 Apr 2024 21:48:23 +0800 Subject: [PATCH 2/2] docs: update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2f66dcf..7c1894d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Go to the `v1` branch to see the changelog of Lume 1. ### Fixed - Updated dependencies: `unocss`, `liquid`, `postcss-nesting`, `terser`, `xml`, `react`, `std`. +- FFF plugin: fix `getGitDate` priority. [#603] ## [2.1.4] - 2024-04-17 ### Added @@ -359,6 +360,7 @@ Go to the `v1` branch to see the changelog of Lume 1. [#598]: https://github.com/lumeland/lume/issues/598 [#599]: https://github.com/lumeland/lume/issues/599 [#600]: https://github.com/lumeland/lume/issues/600 +[#603]: https://github.com/lumeland/lume/issues/603 [2.2.0]: https://github.com/lumeland/lume/compare/v2.1.4...HEAD [2.1.4]: https://github.com/lumeland/lume/compare/v2.1.3...v2.1.4