From 8cf3e3001f2cbd18da73fcc92ae5f4b76d3ecf21 Mon Sep 17 00:00:00 2001
From: Patsagorn Y. <49602385+ptsgrn@users.noreply.github.com>
Date: Thu, 16 Jan 2025 20:44:33 +0000
Subject: [PATCH] feat(i18n): Thai translations (#1722)
---
quartz/plugins/transformers/lastmod.ts | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/quartz/plugins/transformers/lastmod.ts b/quartz/plugins/transformers/lastmod.ts
index 31c8c20..fd57692 100644
--- a/quartz/plugins/transformers/lastmod.ts
+++ b/quartz/plugins/transformers/lastmod.ts
@@ -27,9 +27,7 @@
}
type MaybeDate = undefined | string | number
-export const CreatedModifiedDate: QuartzTransformerPlugin<Partial<Options> | undefined> = (
- userOpts,
-) => {
+export const CreatedModifiedDate: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => {
const opts = { ...defaultOptions, ...userOpts }
return {
name: "CreatedModifiedDate",
@@ -43,18 +41,16 @@
let published: MaybeDate = undefined
const fp = file.data.filePath!
- const fullFp = path.posix.join(file.cwd, fp)
+ const fullFp = path.isAbsolute(fp) ? fp : path.posix.join(file.cwd, fp)
for (const source of opts.priority) {
if (source === "filesystem") {
const st = await fs.promises.stat(fullFp)
created ||= st.birthtimeMs
modified ||= st.mtimeMs
} else if (source === "frontmatter" && file.data.frontmatter) {
- created ||= file.data.frontmatter.date as MaybeDate
- modified ||= file.data.frontmatter.lastmod as MaybeDate
- modified ||= file.data.frontmatter.updated as MaybeDate
- modified ||= file.data.frontmatter["last-modified"] as MaybeDate
- published ||= file.data.frontmatter.publishDate as MaybeDate
+ created ||= file.data.frontmatter.created as MaybeDate
+ modified ||= file.data.frontmatter.modified as MaybeDate
+ published ||= file.data.frontmatter.published as MaybeDate
} else if (source === "git") {
if (!repo) {
// Get a reference to the main git repo.
--
Gitblit v1.10.0