Skip to content

Commit

Permalink
Merge pull request #603 from lumeland/fix/fff
Browse files Browse the repository at this point in the history
fix(plugin/fff): fix `getGitDate` priority
  • Loading branch information
oscarotero committed Apr 29, 2024
2 parents 7c705eb + 6c507cd commit ca33ca8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions plugins/fff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ export default function (userOptions?: Partial<Options>) {
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, [
Expand Down

0 comments on commit ca33ca8

Please sign in to comment.